Commit Graph

49 Commits

Author SHA1 Message Date
Shahbaz Youssefi
3ec6b3698e
spirv-val: Consistently quote ids in messages (#4950)
Half the messages used to output 'id[%name]' and half id[%name].  With
this change, all messages consistently output 'id[%name]'.  Some typos
are also fixed in the process.
2022-09-29 10:03:49 +02:00
Pankaj Mistry
4c456f7da6
Implement tool changes for SPV_EXT_mesh_shader. (#4915)
- Added validation rule to support EXT_mesh_shader from SPIRV 1.4 onwards
2022-09-01 20:36:15 -04:00
luzpaz
65ecfd1093
Fix various source comment (doxygen) typos (#4680)
Found via `codespell -q 3 -L fo,lod,parm
2022-01-26 15:13:08 -05:00
alan-baker
5efeaad309
Fix bad order of checks in atomic validation (#4524)
Fixes https://crbug.com/38625

* Check the type is an integer before checking it's bit width
2021-09-13 11:16:37 -04:00
Jason Ekstrand
3a02d11268
Add validation for SPV_EXT_shader_atomic_float16_add (#4325) 2021-06-24 08:59:43 -04:00
sfricke-samsung
ecdd9a3e6b
spirv-val: Vulkan Storage Class for Execution Model (#4212) 2021-06-10 08:38:23 -04:00
Jason Ekstrand
ecc840d30b
Add validation for SPV_EXT_shader_atomic_float_min_max (#4105)
* Add an "extra_defs" parameter to GenerateShaderCode in atomics_test

* Add validation for SPV_EXT_shader_atomic_float_min_max
2021-03-24 08:49:21 -04:00
sfricke-samsung
f2a19b0150
spirv-val: Refactor of atomic pass (#4200) 2021-03-19 09:23:02 -04:00
sfricke-samsung
a611be7782
spirv-val: Fix Int64Atomics check (#4192) 2021-03-18 10:50:16 -04:00
sfricke-samsung
042eff73fe
spirv-val: Add Vulkan Invocation Sematics check (#4182) 2021-03-16 10:53:37 -04:00
sfricke-samsung
c6da5e343c
spirv-val: Vulkan 64-bit OpAtomicStore check (#4163) 2021-03-08 14:34:06 -05:00
sfricke-samsung
a61600c763
spirv-val: Label Vulkan atomic semantics VUIDs (#4120) 2021-01-25 11:19:06 -05:00
sfricke-samsung
e25db023c4
spirv-val: Add Vulkan Memory Scope VUs (#4106)
* Fix test using Fragment execution
2021-01-19 08:37:42 -05:00
Ryan Harrison
9150cd441f
Remove WebGPU support (#4108)
Leaves SPV_ENV_WEBGPU_0 enum in place, but marked deprecated, so users
of the library are not broken by an API enum being removed.

Fixes #4101
2021-01-14 16:45:18 -05:00
sfricke-samsung
b2cfc5d1ce
spirv-val: Vulkan atomic storage class (#4079)
* spirv-val: Vulkan atomic storage class

* Add PhysicalStorageBuffer
2021-01-14 09:41:18 -05:00
vkushwaha-nv
e4aebf99fa
Add changes for SPV_EXT_shader_atomic_float (#3562) 2020-07-21 10:31:05 -04:00
alan-baker
528c00c016 Re-enable OpReadClockKHR validation (#3013)
Re-enable OpReadClockKHR validation

Fixes #2952

* Refactor some common scope validation
* Perform correct validation for scope in OpReadClockKHR
  * Scope must be Subgroup or Device
* new tests
2019-11-07 09:51:38 -05:00
David Neto
9f188e3374 Assembler: Can't set an ID in instruction without result ID (#2852)
Fix tests that violated this rule.

Fixes #2257
2019-09-11 13:15:25 -04:00
Ryan Harrison
5ada98d0bb Update WebGPU validation rules of OpAtomic*s (#2777)
Fixes #2723
2019-07-31 17:15:47 -04:00
Kévin Petit
11516c0b9a Validate storage class OpenCL environment rules for atomics (#2750)
This change refactors all storage class validation for atomics
to reflect the similar refactoring in the specification.

It is currently not possible to write a test for the check
rejecting Generic in an OpenCL 1.2 environment as the required
GenericPointer capability isn't allowed there. I've decided
to keep the check nonetheless to guard against the capability
becoming available without the rules for atomics being updated.

The ID changes in existing tests aren't ideal but introducing
names drags in a substantial refactoring of this file.

Contributes to #2595.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-22 08:38:42 -04:00
Ryan Harrison
3a252a267b
Update memory scope rules for WebGPU (#2725)
Fixes #2721
2019-07-10 10:34:50 -04:00
alan-baker
3d5fb7b908
Validate Volatile memory semantics bit (#2672)
* Can only be used with Vulkan memory model
* Can only be used with atomics
* Bit setting must match for compare exchange opcodes
* Updated memory semantics checks to allow constant instructions
generally with CooperativeMatrixNV
2019-06-17 13:35:40 -04:00
alan-baker
45fb696668 Use last version (#2578)
* Use grammar last version

Fixes #2560

* Parse last version and use it in checks

* Update grammar header generation

* Fix NonWritable tests

* Fix check and add specific tests
2019-05-10 11:02:01 -04:00
Ryan Harrison
3aad3e9228
Change validation of memory semantics for OpAtomics* in WebGPU (#2519)
Recent change to the spec restricted the valid values for Memory
Semantics in OpAtomics* in the WebGPU env. Implementing enforcing
these changes.

Fixes #2499
2019-04-16 14:49:07 -04:00
Sarah
bf23ed887c
OpAtomicLoad, OpAtomicStore, OpAtomicExchange can operate on int or float value. Except for Vulkan environment that only operates on int value. (#2385)
To fix: #2128. Already implemented. This PR adds witness tests.
2019-02-20 11:00:58 -05:00
Ryan Harrison
7577415cc7
Add in WebGPU specific memory scope validation (#2288)
Fixes #2278
2019-01-17 10:39:35 -05:00
Ryan Harrison
7f57887e05
Remove check for SpvCapabilityAtomicStorage (#2243)
Per conversation on
https://github.com/KhronosGroup/glslang/issues/1618 and other places.
2018-12-18 13:34:30 -05:00
Ryan Harrison
a719fc18a5 Disable checking that AtomicStorage capability is present (#2193)
There is inconsistencies between the different specs about whether or
not this capability is required/allowed, so tooling like glslang
currently ignores it. Once this is resolved the check and test can be
re-enabled.
2018-12-11 14:19:44 -05:00
Ryan Harrison
7c38fee64a
Restrict mask bits for memory semantics in WebGPU (#2180)
Fail to validate memory semantics value if it includes set bits that
are not on the whitelist from the spec.

Fixes #2070
2018-12-07 10:38:52 -05:00
Ryan Harrison
cf37ab7213
Merge two implementations of ValidateMemorySemantics (#2175)
Fixes #2170
2018-12-06 14:38:15 -05:00
alan-baker
b1ff8ba5b9
Check device scope for Vulkan memory model (#2149)
Fixes #2147

* Checks that device scope is not used for availability and visibility
operations unless VulkanMemoryModelDeviceScopeKHR capability is present
* implemented for atomics, barriers and memory instructions currently
2018-12-03 17:15:47 -05:00
dan sinclair
d835d664bd
[val] Fixup id name output (#2158)
This CL changes the id/name output from the validator to always use a
consistent id[%name] style. This removes the need for getIdOrName. The
name lookup is changed to use the NameMapper so the output is consistent
with what the disassembler will produce.

Fixes #2137
2018-12-03 17:01:30 -05:00
alan-baker
d80259d35e
Strict validation of where type ids are acceptable (#2142)
Fixes https://crbug.com/910239

* IdPass catches many instances of invalid references to types
* Test updates
* Added test to catch OpArrayLength issue
2018-12-03 11:03:52 -05:00
alan-baker
6af3c5cbe4
Clean uses of EvalInt32IfConst (#2145)
Fixes #2133

* Don't return OpSpecConstant* as constants in that method
 * cleaned up uses
* added tests to catch shader semantics and scope bugs
2018-11-30 14:00:56 -05:00
Ryan Harrison
625db3890d
Add check for QueueFamilyKHMR memory scope (#2144)
This also fixes a small typo that was causing my test case to fail.

Fixes #2136
2018-11-30 12:52:31 -05:00
Ryan Harrison
2cd040b0d3
Merging two ValidateMemoryScope implementations (#2132)
Fixes #2125
2018-11-29 14:51:17 -05:00
Alan Baker
d652ed3029 Vulkan memory model: semantics validation
Ban sequentially consistent with VulkanKHR

* Added validation check that SequentiallyConsistent memory semantics
are not used if the memory model is VulkanKHR
 * Added tests
* Fixed a bug in evaluating constant 32-bit integers and updated some
handling to avoid inferring a value from a spec constant default

Remaining memory semantics validation

* Adds checks that OutputMemoryKHR, MakeAvailableKHR and MakeVisibleKHR
are only used if the VulkanMemoryModelKHR capabailty is present
* Added checks that MakeAvailableKHR requires release semantics
* Added checks that MakeVisibleKHR requires acquire semantics
* Added checks that MakeAvailableKHR and MakeVisibleKHR require a
storage class
2018-11-19 11:44:20 -05:00
Ben Ashbaugh
d3f88b0841 allow atomics on Function pointers for OpenCL (#1955) 2018-10-09 11:33:01 -04:00
Alan Baker
a77bb2e54b Add validation for execution modes
* Check rules from Execution Mode tables, 2.16.2 and the Vulkan
environment spec

* Allows MeshNV execution model with the following execution modes
 * LocalSize, LocalSizeId, OutputPoints and OutputVertices
 * Done to not break their validation
2018-10-02 10:22:23 -04:00
Lei Zhang
1225324ae2
VK_KHR_shader_atomic_int64 covers OpAtomic{Load|Store} 2018-09-26 16:45:37 -04:00
Lei Zhang
63265097e5
Add support for VK_KHR_shader_atomic_int64 in validator 2018-09-14 14:07:25 -04:00
dan sinclair
eda2cfbe12
Cleanup includes. (#1795)
This Cl cleans up the include paths to be relative to the top level
directory. Various include-what-you-use fixes have been added.
2018-08-03 15:06:09 -04:00
dan sinclair
2cce2c5b97
Move tests into namespaces (#1689)
This CL moves the test into namespaces based on their directories.
2018-07-11 09:24:49 -04:00
Andrey Tuganov
9cf87ecbc8 Add Vulkan specific atomic result type restriction
Atomic instructions must declare a scalar 32-bit integer type for the “Result Type”.
2018-03-26 12:06:25 -04:00
Andrey Tuganov
a61e4c1356 Disable check which fails Vulkan CTS 2018-02-07 13:31:35 -05:00
Andrey Tuganov
2f0c3aaa11 Add Vulkan-specific validation rules for atomics
Added atomic instructions validation rules from
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#spirvenv-module-validation
2018-02-07 13:31:35 -05:00
Andrey Tuganov
44d88c8d9c Add memory semantics checks to validate atomics 2018-01-30 18:00:01 -05:00
Andrey Tuganov
b2eb840468 Validator: restricted some atomic ops for shaders
Ban floating point case for OpAtomicLoad, OpAtomicExchange,
OpAtomicCompareExchange. In graphics (Shader) environments, these
instructions only operate on scalar integers. Ban the floating point
case. OpenCL supports atomic_float.
2018-01-24 14:06:06 -08:00
Andrey Tuganov
532b327d4d Add validation rules for atomic instructions
Validates all OpAtomicXXX instructions.
2017-12-13 18:29:38 -05:00