summaryrefslogtreecommitdiffstats
path: root/src/vulkan/util
Commit message (Collapse)AuthorAgeFilesLines
* vk_util: drop duplicate formats in vk_format_map[]Eric Engestrom2019-11-211-2/+0
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util: add missing R8G8B8A8_SRGB format to vk_format_mapJonathan Marek2019-11-211-0/+1
| | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util: Add a mapping from VkFormat to PIPE_FORMAT.Eric Anholt2019-11-193-0/+262
| | | | | | | I'm planning on using this from radv and tu for queries about formats. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Jonathan Marek <[email protected]>
* util: rename list_empty() to list_is_empty()Timothy Arceri2019-10-281-1/+1
| | | | | | | This makes it clear that it's a boolean test and not an action (eg. "empty the list"). Reviewed-by: Eric Engestrom <[email protected]>
* meson: drop duplicate source & inc_dirEric Engestrom2019-07-011-2/+0
| | | | | | | These two are already pulled from `idep_vulkan_util_headers`. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vk/util: suppress warning about out-of-enum android valueEric Engestrom2019-05-231-2/+4
| | | | | | | | | | src/vulkan/util/vk_enum_to_str.c: In function ‘vk_structure_type_size’: src/vulkan/util/vk_enum_to_str.c:3335:9: warning: case value ‘1000010000’ not in enumerated type ‘VkStructureType’ {aka ‘const enum VkStructureType’} [-Wswitch] case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: return sizeof(VkNativeBufferANDROID); ^~~~ Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vk/util: drop no-op compiler warning workaroundEric Engestrom2019-05-231-19/+5
| | | | | | | | | | `-Wswitch` applies to `switch()`, not `case:`, and is bypassed by the presence of a `default:` anyway, so let's drop the `default:` and move the warning suppression to where it can make a difference, and then it turns out that we don't need to keep a list of special cases anymore :) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan: fix build dependency issue with generated filesLionel Landwerlin2019-05-221-0/+12
| | | | | | | | | | | | | On machines with many cores, you can run into that issue : ../mesa-9999/src/vulkan/overlay-layer/overlay.cpp:42:10: fatal error: vk_enum_to_str.h: No such file or directory v2: Move declare_dependency around (Eric) Signed-off-by: Lionel Landwerlin <[email protected]> Reported-by: Jan Ziak Cc: <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan/util: generate a helper function to return pNext struct sizesLionel Landwerlin2019-05-022-4/+54
| | | | | | | | | | | | | | This will be used to copy chains of structures so that we can alterate some of them. v2: Drop vk_util.h include (Eric) Use VkBaseInStructure directly (Eric) v3: Drop --platforms= param to generator script, instead produce a file with #ifdef based what platforms are compiled. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* delete autotools .gitignore filesEric Engestrom2019-04-291-1/+0
| | | | | | | | One special case, `src/util/xmlpool/.gitignore` is not entirely deleted, as `xmlpool.pot` still gets generated (eg. by `ninja xmlpool-pot`). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* anv: implement VK_KHR_swapchain revision 70Lionel Landwerlin2019-04-081-0/+12
| | | | | | | | | | | | | | | | | | This revision allows for images to be : - created by reusing image parameters from swapchain - bound to memory from a swapchain v2: Add color attachment flag Use same implicit WSI parameters (tiling, samples, usage) v3: Fix missing break in vk_foreach_struct_const() switch (Lionel) v4: Fix accessing image aspects before android resolve (Tapani) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* vk/util: remove unneeded array indexEric Engestrom2019-04-081-1/+1
| | | | | | | | | This is an array of 1, so [0] is the only content, and meson already flattens the list so this is unnecessary. Also, all the other uses of vk_api_xml don't do that. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan/util: Handle enums that are in platform-specific headers.Bas Nieuwenhuizen2019-03-181-0/+23
| | | | | | | | | | | | VkFullScreenExclusiveEXT comes from the win32 header. Mostly took the logic from the entrypoint scripts: 1) If there is an ext that has it in the requires and has a platform, take the guard for that platform. 2) Otherwise assume it is from the core headers. Acked-by: Samuel Pitoiset <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan: factor out wsi dependenciesLionel Landwerlin2019-03-181-7/+1
| | | | | | | | | | | | | In commit 530927d3f6a303d9 ("vulkan/util: generate instance/device dispatch tables") we started generating instance dispatch tables some of them (like wayland) require external headers. This commit moves the dependencies up one level so that they apply the whole vulkan directory. We use them for both the util & overlay layer. Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: 530927d3f6a303 ("vulkan/util: generate instance/device dispatch tables") Reviewed-by: Eric Engestrom <[email protected]>
* vulkan/util: meson build - add wayland client includeTobias Klausmann2019-03-171-0/+7
| | | | | | | | | | | | | | | | | | | Without this the build breaks with: In file included from ../src/vulkan/util/vk_util.h:32, from ../src/vulkan/util/vk_util.c:28: ../include/vulkan/vulkan.h:51:10: fatal error: wayland-client.h: No such file or directory #include <wayland-client.h> ^~~~~~~~~~~~~~~~~~ compilation terminated. The above misses the include directory for wayland: -I/usr/include/wayland Signed-off-by: Tobias Klausmann <[email protected]> Cc: [email protected] Reviewed-by: Eric Engestrom <[email protected]>
* vulkan/overlay: fix missing var rename in previous commitEric Engestrom2019-03-071-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan/util: use the platform defines in vk.xml instead of hard-coding themEric Engestrom2019-03-071-9/+10
| | | | | | | See also: 3d4238d26c5de4a0f7a5 "anv: use the platform defines in vk.xml instead of hard-coding them" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan/util: generate instance/device dispatch tablesLionel Landwerlin2019-03-062-6/+114
| | | | | | | | This will be used by the overlay instead of system installed validation layers helpers. Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* vulkan/util: make header available from c++Lionel Landwerlin2019-03-061-1/+9
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* meson: remove unused include_directories(vulkan)Eric Engestrom2019-03-061-1/+1
| | | | | | | The correct include path is "vulkan/…". Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: use VkBase{In,Out}Structure instead of a custom structEric Engestrom2019-02-281-7/+2
| | | | | | | | | VkBaseInStructure and VkBaseOutStructure are part of vulkan_core.h (which is part of vulkan.h) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan: make generated enum to strings helpers available from c++Lionel Landwerlin2019-01-221-0/+8
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* vulkan/utils: s/VERSION/PACKAGE_VERSION/Eric Engestrom2018-11-261-3/+3
| | | | | | | | | | | Everything else uses PACKAGE_VERSION, so let's be consistent, and VERSION and PACKAGE_VERSION are currently defined to be the same in meson and android, while VERSION is undefined in autotools and scons. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan/alloc: Add a vk_strdup helperJason Ekstrand2018-08-281-0/+17
| | | | | Cc: "18.2" <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* meson: Build with Python 3Mathieu Bridon2018-08-101-1/+1
| | | | | | | | | | | | Now that all the build scripts are compatible with both Python 2 and 3, we can flip the switch and tell Meson to use the latter. Since Meson already depends on Python 3 anyway, this means we don't need two different Python stacks to build Mesa. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: utils: handle hexadecimal values in registryLionel Landwerlin2018-07-061-1/+1
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* vulkan/util: Add a helper to get a version overrideJason Ekstrand2018-03-072-0/+22
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* vulkan/enum_to_str: Add support for aliases and new Vulkan versionsJason Ekstrand2018-03-071-5/+20
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* vulkan/enum_to_str: Add a add_value_from_xml helper to VkEnumJason Ekstrand2018-03-071-13/+15
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* vulkan: move anv VK_EXT_debug_report implementation to common code.Bas Nieuwenhuizen2018-01-173-0/+196
| | | | | | | | | | For also using it in radv. I moved the remaining stubs back to anv_device.c as they were just trivial. This does not move the vk_errorf/anv_perf_warn or the object type macros, as those depend on anv types and logging. Reviewed-by: Tapani Pälli <[email protected]>
* meson: Use consistent styleDylan Baker2018-01-111-2/+4
| | | | | | | | | | | | | | | | | | | | Currently the meosn build has a mix of two styles: arg : [foo, ... bar], and arg : [ foo, ..., bar, ] For consistency let's pick one. I've picked the later style, which I think is more readable, and is more common in the mesa code base. v2: - fix commit message Acked-by: Eric Engestrom <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
* vulkan: util: add macros to extract extension/offset number from enumsLionel Landwerlin2017-10-061-0/+6
| | | | | | | | | v2: Simplify offset enum computation (Jason) v3: capitalize macros (Chad) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* meson: Add build Intel "anv" vulkan driverDylan Baker2017-09-271-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows building and installing the Intel "anv" Vulkan driver using meson and ninja, the driver has been tested against the CTS and has seems to pass the same series of tests (they both segfault when the CTS tries to run wayland wsi tests). There are still a mess of TODO, XXX, and FIXME comments in here. Those are mostly for meson bugs I'm trying to fix, or for additional things to implement for other drivers/features. I have configured all intermediate libraries and optional tools to not build by default, meaning they will only be built if they're pulled in as a dependency of a target that will actually be installed) this allows us to avoid massive if chains, while ensuring that only the bits that need to be built are. v2: - enable anv, x11, and wayland by default - add configure option to disable valgrind v3: - fix typo in meson_options (Nicholas) v4: - Remove dead code (Eric) - Remove change to generator that was from v0 (Eric) - replace if chain with loop (Eric) - Fix typos (Eric) - define HAVE_DLOPEN for both libdl and builtin dl cases (Eric) v5: - rebase on util string buffer implementation Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (v4)
* vulkan: enum generator: Generate entries for extended enumsJason Ekstrand2017-09-221-8/+40
| | | | Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: Stop using iterparseJason Ekstrand2017-09-221-26/+10
| | | | | | | | While using iterparse is potentially a little more efficient, the Vulkan registry XML is not large and using regular element tree simplifies the parsing logic substantially. Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: generate extension number definesLionel Landwerlin2017-09-221-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New extensions can introduce additional enums. Most of the new enums will have disjoint numbers from the initial enums. For example new formats introduced by VK_IMG_format_pvrtc : VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, It's obvious we can't have a single table for handling those anymore. Fortunately the enum values actually contain the number of the extension that introduced the new enums. So we can build an indirection table off the extension number and then index by subtracting the first enum of the the format enum value. This change makes the extension number available in the generated enum code. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: make registry more flexibleLionel Landwerlin2017-09-221-9/+9
| | | | | | | | | It will be used to store extension numbers as well. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: sort enums by namesLionel Landwerlin2017-09-221-1/+2
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: align function declarations/prototypesLionel Landwerlin2017-09-221-21/+21
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan/registry: Feed vk_android_native_buffer.xml to gen_enum_to_str.pyChad Versace2017-09-181-1/+19
| | | | | | Tested on Android and Fedora. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/util: Teach gen_enum_to_str.py to parse mutliple XML filesChad Versace2017-09-181-8/+11
| | | | | | | | | | | | | To give the script multiple XML files, call it like so: gen_enum_to_str.py --xml a.xml --xml b.xml --xml c.xml ... The script parses the XML files in the given order. This will allow us to feed the script XML files for extensions that are missing from the official vk.xml, such as VK_ANDROID_native_buffer. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/util: Add a vk_zalloc helperJason Ekstrand2017-08-281-0/+14
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan/util: fix typo in commentEric Engestrom2017-07-181-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* radv/vulkan: Move radv_get_driver_version to src/vulkan/utilAlex Smith2017-06-062-0/+51
| | | | | | | | | | | | This means it can be reused for other Vulkan drivers. Also fix up a typo, need to search for '.' in the version string rather than ','. v2: Remove unneeded temporary version variable (Emil, Eric) Signed-off-by: Alex Smith <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* util/vulkan: Move Vulkan utilities to src/vulkan/utilAlex Smith2017-06-062-0/+294
| | | | | | | | | | | | | We have Vulkan utilities in both src/util and src/vulkan/util. The latter seems a more appropriate place for Vulkan-specific things, so move them there. v2: Android build system changes (from Tapani Pälli) Signed-off-by: Alex Smith <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* vulkan: provide vk.xml as argument to the python generatorEmil Velikov2017-02-281-3/+2
| | | | | | | | | | | Do not hardcode the file in the python script, but pass it via the build system(s). The latter is the only one that should know about the file location/tree structure. Cc: Dylan Baker <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* android: vulkan: add support for libmesa_vulkan_utilMauro Rossi2017-02-281-2/+10
| | | | | | | | | | | | | | | | | | | | The following changes are implemented: Add src/vulkan/Android.mk to build libmesa_vulkan_util Android.mk: add src/vulkan to SUBDIR to build new module intel/vulkan: fix libmesa_vulkan_util,vk_enum_to_str.h dependencies Add -o OUTPUT_PATH option in src/vulkan/util/gen_enum_to_str.py script Use -o OUTPUT_PATH option in automake generation rules for vk_enum_to_str.{c,h} Fixes: e9dcb17 "vulkan/util: Add generator for enum_to_str functions" Fixes: 8e03250 "vulkan: Combine wsi and util makefiles" Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]> [Emil Velikov] - Move parser within main() - Use --outdir instead of -o Signed-off-by: Emil Velikov <[email protected]>
* vulkan: Combine wsi and util makefilesDylan Baker2017-02-222-24/+2
| | | | Reviewed-by: Matt Turner <[email protected]>
* vulkan/util: Add generator for enum_to_str functionsDylan Baker2017-02-223-0/+195
This adds a python generator to produce enum_to_str functions for Vulkan from the vk.xml API description. It supports extensions as well as core API features, and the generator works with both python2 and python3. Signed-off-by: Dylan Baker <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jason Ekstrand <[email protected]>