Commit Graph

78 Commits

Author SHA1 Message Date
andrew0229
0281b281d0 update to v1.3.275
Signed-off-by: andrew0229 <zhangzhao62@huawei.com>
Change-Id: Ifc4224db2c6ea7c159d3cabe8f075475d47a41a8
2024-05-21 08:09:09 +00:00
Mark Young
b21acf16e7 Update loader to include handle validation
Validate the Vulkan dispatchable handles (VkInstance, VkPhysicalDevice, etc) for
any trampoline functions the loader uses to query the dispatch table from.
This is so we can at least report errors before something bad happens.

Also, add tests to the test framework to catch this case.  Right now they simply
check to make sure we aborted, but they don't know why the loader aborted.
Eventually, we need to come back and check the loader messages and make sure it
aborted for the reasons we want.

Fix a generator warning in dispatch_table_helper_generator.py where a compare was
the wrong type.

Fixes GH Issue #64.
2021-11-19 10:32:13 -07:00
Mike Schuchardt
1d30345f2b scripts: Use altlen instead of parsing latexmath
KhronosGroup/Vulkan-ValidationLayers switched to this method a while ago
and this syncs the KhronosGroup/Vulkan-Loader version of
helper_file_generator.py to match.
2021-08-10 12:40:45 -07:00
Shannon McPherson
a173c025f8 build: Update known-good files for 1.2.145 header
Changes:
- Updated `known_good.json`
- Propagated `loader_genvk.py` changes
- Modified scripts to accommodate new genvk functionality
- Generated new source files

Change-Id: If54251171bb3c70cef305d1e954aa02124432106
2020-06-22 11:08:36 -06:00
dan sinclair
a09970273c scripts: Use named params for generator options
When calling in the vulkan header python generator the options have
changed in 1.2.142 which causes the options passed by the loader to be
off by one. This ends up setting the emitExtensions to the value of the
sortProcedure and eventually causes the script to fail.

This CL updates the loader to used named parameters for the generator so
that the addition of the genpath does not throw off the parameter
positioning.

Change-Id: I14fda7e90be985216c5243457a22fdcb01b5c82b
2020-06-09 16:24:23 -06:00
Mike Schuchardt
0b9462b74d scripts: Tweak extension detection
Use tag type instead of feature name
2020-01-15 11:55:43 -07:00
Lenny Komow
153ba165ce scripts: Remove unused codegen from build
There was some old codegen that was used for generating validation
layers when those were in the same repo as the loader. Since they're
separate, we can remove the files so they only exist in the layers
repo.

Change-Id: Ia72f235ea0617f25258631e1003123ec3edd88d4
2019-05-07 11:37:20 -06:00
Mike Schuchardt
1df2ebd329 scripts: Update known-good for 1.1.106 header
Changes:
- Integrate upstream script changes: We have to plumb-through the new
conventions object to continue using the makeCParamDecl utility function
- Add GGP to available platforms
- Add handling for extension dependencies: Previously, the codegen for
loader trampolines could not handle an extension command that depends on
more than one extension being present. This removes that limitation
- Add checks for device extensions: This adds a check for two functions
at device creation time:
  * VK_KHR_device_group
  * VK_EXT_full_screen_exclusive
The loader needs to know about these extensions for proper handling
of the vkGetDeviceGroupSurfacePresentModes2EXT terminator
- Update known-good file

Updated:
- `loader/loader.c`
- `loader/loader.h`
- `scripts/common_codegen.py`
- `scripts/dispatch_table_helper_generator.py`
- `scripts/helper_file_generator.py`
- `scripts/known_good.json`
- `scripts/loader_extension_generator.py`
- `scripts/loader_genvk.py`

Change-Id: I9f0828a8eee0e8e95b479e1b8feb31acaa10040d
2019-04-08 16:38:37 -06:00
Michał Janiszewski
af584f26fd scripts: Compare to None using is operator
This is a trivial change that replaces `==` operator with `is` operator, following PEP 8 guideline:

> Comparisons to singletons like None should always be done with is or is not, never the equality operators.

https://legacy.python.org/dev/peps/pep-0008/#programming-recommendations

Change-Id: I4f9f6c921e4158365d4e41965bfcd43b7a3c07e0
2018-11-01 13:26:26 -06:00
Shannon McPherson
a8899f16fa scripts: Extend scope of LaTeX handling
The 1.1.90 header introduced the use of "\textrm" in `vk.xml`, requiring
changes to `scripts/helper_file_generator.py`

Change-Id: I0ee5012611d95cfdd1715a4e870a3b2b4e7556ee
2018-10-30 11:37:59 -06:00
John Zulauf
1ab6735ae1 layers: Add missing promoted device extensions
Add three missing device extensions to promoted device extensions list
in vk_extension_helper codegen.

    VK_KHR_relaxed_block_layout
    VK_KHR_shader_draw_parameters
    VK_KHR_storage_buffer_storage_class

Change-Id: I392155d318ca580e576436ef46695218e5eb446e
2018-04-27 10:38:02 -06:00
John Zulauf
413ba876d5 layers: Sort promoted extensions list
For ease of maintenance, sort the promoted extension lists.

Change-Id: Ib1d690d55c6b9c3a156c9682fbe96bbebed17c14
2018-04-27 10:38:02 -06:00
John Zulauf
0da2042381 layers: Add dependency info to vk_extension_helper
Add additional metadata to *Extensions structs to enable extension
dependency validation at CreateInstance CreateDevice time.

Refactor the code generator for the extension helper prior to
refactoring the generated code to address an incomplete.

Change-Id: I79ae680d9c41f1f153ee8108d4deac8ec8c5a886
2018-04-25 15:15:22 -06:00
John Zulauf
2ce128f805 layers: Refactor codegen for vk_extension_helper
Refactor vk_extension helper prior to adding extension dependency
information to code gen. Refactor to simplify feature addition.

Change-Id: I7b2902dd1a4070c83810f57c0836b50cb6ecfb86
2018-04-25 15:15:22 -06:00
John Zulauf
338111e777 layers: Sort extension order for extension helper
Sorted the extensions by name s.t. the output of the vk_extension_helper
generator would be consistent run-to-run.

Change-Id: Ief3d822b91260e469f7f2d563076d8a79f1a1bf0
2018-04-25 15:15:22 -06:00
John Zulauf
b0b9c66f7f layers: Add correct validation for apiVersion
Update and correct validation of passed apiVersion for 1.1 specified
behavior.  Instances with apiVersion > 1.1 will be validated as 1.1
instances (and warn).  Instances with apiVersions < 0 and < 1.0 will be
validated as 1.0 instances and generate an error.  Instances with
missing or 0 apiVersions will be treated as 1.0 instances.

LOGCONSOLE warning converted to log_msg warning.

Change-Id: I2debb6175cf094918fc86cdea2973ddae9479a0b
2018-04-03 16:35:29 -06:00
Mark Young
5fd16bf818 layers: Fix gh #2504 and compiler warnings
Remove extraneous objecgt info from the validation logging message.
Extra object logging was added accidentally in my change to
incorporate VK_EXT_debug_utils.

Fix output of Debug Utils messenger output for validation layers
to list individual objects.

Also, fixed a few compiler warnings that were appearing on Linux.

Change-Id: I043d7f734683dfa79fe7a26a5973975bde011cce
2018-03-28 13:06:22 -06:00
Mark Lobodzinski
299b31902c scripts: Fix safe_struct Android versioning issue
The VK_ANDROID_external_memory_android_hardware_buffer extension uses
an android structure that is undefined before android 'O'. Worked around
this issue by defining a dummy structure for earlier android OS versions.

Change-Id: If515920d3b1707cbeb6a0377827c680d93d516ff
2018-03-26 15:29:06 -06:00
John Zulauf
78f1490bd6 layers: Add alias support to kVulkanObjectTypes
Updated vk_object_types.h generation to correctly handle promoted and
alias handle types.

Change-Id: I3d655b0f408a6cee08bf3d1ce453d9c5aac61376
2018-03-20 08:59:20 -06:00
John Zulauf
42493eb5c4 layers: Fix enum cross reference to handle missing
Modify enum cross reference table creation to handle missing items from
VK_DEBUG_REPORT_OBJECT_TYPE_ list, as it is no longer being updated.

Change-Id: I112a08f82249c446757495309699c80fe7094635
2018-03-20 08:59:20 -06:00
Gabríel Arthúr Pétursson
8221c513aa layers: Fix incorrect generation of get_debug_report_enum
There is no corresponding DebugReportObjectType enum for
kVulkanObjectTypeDebugUtilsMessengerEXT, so map it to the unknown type.

The generation script skipped over this enum, causing buffer overflow
faults in the VkLayerTest.ValidationCacheTestBadMerge test.
2018-03-19 10:31:46 -06:00
Mark Lobodzinski
f8dc6f1520 scripts: Remove helper-generator struct_size source
This was unused in this repository.

Change-Id: I3e3375139cf2718e4aff4ee2237bc1d756cd0205
2018-03-16 10:34:02 -06:00
Mike Schuchardt
cf286915e6 scripts: helper_file_generator.py cleanup
- Remove list as set anti-pattern
- Remove conditional that could never evaluate to False
2018-03-09 13:54:31 -07:00
David Pinedo
a1c7e484c2 scripts: Roundup strings sizes in struct to multiple of 4
vktrace layer needs strings sizes to be multiple of 4 for
data alignment in the trace file.
2018-03-09 13:54:31 -07:00
Mark Young
bf9350bc13 helper: Fix compilation warning
Adding vk_enum_string_helper.h produced a warning that
GetPhysDevFeatureString was unused.  Made it inline (as all
the other commands are in that header) and it made the compiler
happy.

Change-Id: I9452ddfc8de4af4c88b95e380b9520d9f59796da
2018-03-09 13:54:31 -07:00
Mike Schuchardt
3b3c0fddcc scripts: Update codegen to work with new aliasing
Change-Id: I3739f7b7b6eb17a5e3e1bc9cc18e74569cb50f95
2018-03-09 13:54:31 -07:00
Mark Young
e3e9b56d9e Implement initial VK_EXT_debug_utils changes
This affects the loader, scripts, and layers and introduces the
changes to support the VK_EXT_debug_utils extension.

Change-Id: Ia5336f63e85b00f1e59416c06aacd4ae331fd692
2018-03-09 13:54:31 -07:00
Mark Lobodzinski
a55869d042 layers: Enable 1.0 exts moved to 1.1 core
Also plumbed api_version into CV and PV for validation and enabling
the appropriate 1.0 extensions by default in 1.1.
2018-03-09 13:54:31 -07:00
Mark Lobodzinski
cd868b5d32 scripts: Update generators for 1.1 2018-03-09 13:54:31 -07:00
Mark Lobodzinski
2861a5c2e2 scripts: Avoid duplicates in enum string helper 2018-03-09 13:54:31 -07:00
Mark Lobodzinski
85a595f54b scripts: Allow for skipping version_1_1 features
Treat 1.1 features as 1.0, instead of as an extension.
2018-03-09 13:54:31 -07:00
John Zulauf
54d28b5b16 layer: Add utility template for sType init
Add utility function to auto populate sType field based on typename
given to autogen of typemap helper. Return value optimization (copy
elision) should make this perfomance neutral vs. inline init.

Change-Id: I231cf92d5063c19f9ad5b14189dd162fdac76a43
2018-01-26 13:00:21 -07:00
Mark Lobodzinski
ffa4734ffb layers: Create instance & device extension lists
Added constant lists of device and instance extension names to
vk_extension_helper.h.

Change-Id: I4273aea866cbfea176a2631e04223ce92443caf0
2018-01-05 10:37:58 -07:00
Petr Kraus
c441fd2424 layers: Ignore pImmutableSamplers on non-samplers 2017-12-19 10:04:42 -07:00
Petr Kraus
d3a22871be layers: Fix Graphics Pipeline pointers not ignored
Some VkGraphicsPipelineCreateInfo pointers must be ignored under some
conditions, but were not in the layers.

Add relevant tests.

Fix tests found broken (using depth or color without attachment in
subpass)
2017-12-15 12:35:29 -07:00
Mike Schuchardt
65976b0d19 layers: VS2013 compatibility
Remove all usages of constexpr to restore compatibility with Visual Studio
2013.  Also make a handful of other minor edits where the VS2013
compiler was reporting errors.

Change-Id: I3c426bea460a4a902ab306b01deb1d76d60f5fa2
2017-12-08 09:27:08 -07:00
Mark Lobodzinski
ecd941459f scripts: Fix incorrect object type mappings
'Unknown' type was at the end of a couple of the lists, causing
incorrect IDs to be emitted.

Change-Id: I55cae6ecaff47977dca78e2f73468980f9450bda
2017-11-15 10:34:31 -07:00
John Zulauf
5dcfa59551 layers: Refactored pNext chain walks to template
The while loops for the walking the pNext chains were implemented by
repeated code. These were refactored into a common template.  Added
autogenerated 'traits' objects for the pNext linked structs.

Delete cut and paste duplicate pNext chain walk.

Change-Id: I46457bb5432219c74f9356e5230c70e4a9ef16df
2017-11-03 09:31:30 -06:00
Joey Bzdek
a50ee9a19d scripts: Remove asserts from struct size helpers
Unknown structures will return a 0 size instead of failing, in order for
them to be ignored properly.
2017-10-19 15:13:46 -06:00
David Pinedo
b20f2b92b7 scripts: add get_struct_size helper function
Change-Id: I12494a129ef8be68170dddf4efe6762f4051b116
2017-10-10 15:43:46 -06:00
Chris Forbes
dddd846aa7 scripts: Generate copy assignment operators for safe_* 2017-10-04 07:26:55 -07:00
Mark Lobodzinski
42defee502 Revert "layers: Fix Graphics Pipeline pointers not ignored"
This caused segfaults on Intel Skylake, NexusPlayer, and
Samsung Galaxy S8 (Mali).

This reverts commit 367d276ffe5c0748ff9d8e2b3551d4a00c9fc3c2.
2017-09-12 09:50:25 -06:00
Petr Kraus
22b270d1b3 layers: Fix Graphics Pipeline pointers not ignored
Some VkGraphicsPipelineCreateInfo pointers must be ignored under some
conditions, but were not in the layers.

Add relevant tests.

Fix tests found broken (using depth or color without attachment in
subpass)

Change-Id: I3e2a3f61a52c72ce3a11483ff8b031189f4c61c9
2017-09-12 08:35:17 -06:00
Mike Schuchardt
c7c26206fe scripts: Fix VkShaderModuleCreateInfo safe struct
Allocate and copy the entire shader program instead of just the first 4
bytes.

Change-Id: I24dd136d59952f9e8b690bf4fe1702106482a3be
2017-09-07 14:19:31 -07:00
Mark Lobodzinski
6630ac1e69 scripts: Add PDevFeature index print helper
In the Enum string helper header, tack on a routine to convert an
index into a VkPhysicalDeviceFeatures structure into its
corresponding feature string.

Change-Id: I8fbfb6fcbfa63361a851ffc93ffd832696050d51
2017-07-25 10:04:50 -06:00
Mike Schuchardt
1c8aaaba03 scripts: Switch codegen to use structextends
Replace all usages of the deprecated validextensionstructs member
attribute with the registry.validextensionstructs dict.  Internally the
registry builds this extension dictionary using the new structextends
type attribute.

Change-Id: I072ff707bfdfa1f576266291e4196837da526287
2017-07-25 07:54:41 -06:00
Mark Young
166e642627 header: Update to 1.0.54 Vulkan release
Update the headers and xml file with the latest spec changes for
Vulkan 1.0.54.  Also, make corresponding loader and layer changes
to support the new extensions.

Change-Id: I11273c5e3e828743f904e4f0b4b2f2c3a7804df0
2017-07-13 10:06:43 -06:00
Tobin Ehlis
b38cd94647 scripts:Include string.h in ext helper
vk_extension_helper.h uses strcmp so add include of string.h to make
sure this dependency is correctly met.
2017-06-16 09:11:15 -06:00
Tobin Ehlis
37875ffc1c scripts:Add includes to extension helper
Generated extension helper has dependencies on vulkan.h and
utility (for std::pair) that weren't declared.
2017-06-12 09:55:09 -06:00
Mark Lobodzinski
64d4493450 scripts: Add codegen for vk_extension_helper.h
This file replaces device_extensions.h and will help to unify
extension enable handling across the validation layers.

Change-Id: I00eb187423e5d912bae64c0e026f34496be185de
2017-06-06 14:36:42 -06:00