Commit Graph

147 Commits

Author SHA1 Message Date
wangshi 668af1a8df 适配v2021.1版本
Signed-off-by: wangshi <wangshi@kaihong.com>
2023-01-13 14:52:09 +08:00
wangshi 8a4efca23a 移植spirv-tools,适配vkgl测试套件的编译
Signed-off-by: wangshi <wangshi@kaihong.com>
2022-11-15 15:44:19 +08:00
Spencer Fricke 81d098cc4d spirv-val: Add PerVertexKHR (#4807) 2022-05-26 13:11:05 -04:00
stu-s ed7f652d4c Add SPV_KHR_fragment_shader_barycentric support (#4805)
* Add SPV_KHR_fragment_shader_barycentric support
2022-05-25 09:20:39 -04:00
Daniel Koch 424ed471de spirv-val: Add CullMaskKHR support (#4792)
Co-authored-by: sfricke-samsung <s.fricke@samsung.com>
2022-05-06 07:32:56 -04:00
sfricke-samsung 609f1abf43 spirv-val: Add more Vulkan VUID labels (#4764) 2022-03-25 09:29:19 -04:00
sfricke-samsung b18e99c82c spirv-val: Clean up VariablePointers logic (#4755) 2022-03-24 12:02:29 -04:00
Roy.li dcff378c34 Use types have same widths in loop condition. (#4763) 2022-03-24 14:07:22 +00:00
sfricke-samsung 8ddb011700 spirv-val: Add Vulkan 32-bit bit op Base (#4758) 2022-03-23 13:55:42 -04:00
sfricke-samsung bbd8780a12 spirv-val: Label and add test for PSB Aligned (#4756) 2022-03-23 11:08:21 -04:00
sfricke-samsung b5a8d71374 spirv-val: Add Vulkan Dref not allowed 3D dim VUID (#4751) 2022-03-10 13:08:26 -05:00
sfricke-samsung 45e6b50be6 spirv-val: Add Vulkan Image VUID 06214 (#4750) 2022-03-10 13:06:48 -05:00
sfricke-samsung 14f5c7eba9 spirv-val: Label Vulkan RuntimeArray VUID (#4749) 2022-03-10 13:05:26 -05:00
sfricke-samsung b7a1970ed5 spirv-val: Label VUID 06491 (#4745) 2022-03-07 12:30:05 -05:00
sfricke-samsung 9814f1b0f6 spirv-val: Label Vulkan VUID 04734 (#4739) 2022-03-04 10:07:24 -05:00
luzpaz 007d6c3338 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 413bc3854b Vulkan 1.3 (#4686)
* Add new environment enum for Vulkan 1,3
* Do not require --allow-localsizeid in Vulkan 1.3 to use LocalSizeId
  execution mode
2022-01-25 10:36:08 -05:00
David Neto 1da4c9132b Patch location validation VUIDs (#4664)
* spirv-val: Add Vulkan Location VUID

* Simplify: interface checking already does all the work

Co-authored-by: sfricke_samsung <s.fricke@samsung.com>
2021-12-16 15:25:23 -05:00
alan-baker 8d294e2299 Basic support for SPIR-V 1.6 (#4663)
* Basic support for SPIR-V 1.6

* Update SPIRV-Headers deps
* Add new environment enum for SPIR-V 1.6
* Make default environment 1.6 for most tools
* Update tests
* Disallow conditional branch with duplicate labels
* Disallow Dim=Buffer with sampled images
* Do not require the non-semantic extension after SPIR-V 1.5
2021-12-15 14:38:28 -05:00
Marius Hillenbrand 05b9c1a0f4 Fix endianness of string literals (#4622)
* Fix endianness of string literals

To get correct and consistent encoding and decoding of string literals
on big-endian platforms, use spvtools::utils::MakeString and MakeVector
(or wrapper functions) consistently for handling string literals.

- add variant of MakeVector that encodes a string literal into an
  existing vector of words
- add variants of MakeString
- add a wrapper spvDecodeLiteralStringOperand in source/
- fix wrapper Operand::AsString to use MakeString (source/opt)
- remove Operand::AsCString as broken and unused
- add a variant of GetOperandAs for string literals (source/val)
... and apply those wrappers throughout the code.

Fixes  #149

* Extend round trip test for StringLiterals to flip word order

In the encoding/decoding roundtrip tests for string literals, include
a case that flips byte order in words after encoding and then checks for
successful decoding. That is, on a little-endian host flip to big-endian
byte order and then decode, and vice versa.

* BinaryParseTest.InstructionWithStringOperand: also flip byte order

Test binary parsing of string operands both with the host's and with the
reversed byte order.
2021-12-08 12:01:26 -05:00
alan-baker 25c416230a Improve decoration validation (#4490)
Fixes #4469

* Checks that decorations only usable with structure members are not
  used by OpDecorate or OpDecorateId
* Checks that decorations not allowed on structure members are not used
  with OpMemberDecorate
* Checks decoration targets for most core decorations
* Performs some Vulkan specific validation on deorations
2021-11-05 13:18:19 -04:00
sfricke-samsung fd4882d570 spirv-val Update LocalSizeId VUID (#4602) 2021-10-29 11:58:02 -04:00
alan-baker c11093f885 Change validator boolean tests to avoid asserts (#4503)
Fixes https://crbug.com/38102

* Check for valid instructions in many boolean tests instead of
  asserting in ValidationState_t
2021-09-12 19:14:33 -04:00
gnl21 dcb2740ffb Add a feature for allowing LocalSizeId (#4492)
Allow LocalSizeId as a way of sizing compute workgroups where the
environment allows it. A command-line switch is also added to force
acceptance even where the environment would not otherwise allow it.
2021-08-26 14:33:19 -04:00
alan-baker 49c45753cf Disallow loading a runtime-sized array (#4473)
* Disallow loading a runtime-sized array

Fixes #4472

* Disallow loading a runtime-sized array or a composite containing one
* Refactor type traversal into a separate function used by both runtime
  array checks and sized int/float checks
* Update invalid tests
2021-08-16 18:23:10 -04:00
sfricke-samsung f310b8045b spirv-val: Label VUID 04780 (#4334) 2021-06-21 09:33:07 -04:00
sfricke-samsung 494adfa78a spirv-val: Add GLCompute to VUID 04644 message (#4333) 2021-06-21 09:31:55 -04:00
sfricke-samsung 9da5a2751d spirv-val: Vulkan Storage Class for Execution Model (#4212) 2021-06-10 08:38:23 -04:00
sfricke-samsung ba18e1f0b9 spirv-val: Label VUID 04643 (#4202) 2021-03-19 09:02:48 -04:00
sfricke-samsung a5a103fe2d spirv-val: Label VUID 04667 (#4201) 2021-03-19 08:57:36 -04:00
sfricke-samsung aa39e21890 spirv-val: Add Vulkan Execution Scope checks (#4183)
* spirv-val: Add Vulkan Execution Scope checks
2021-03-17 10:00:11 -04:00
sfricke-samsung 9d88d9eebc spirv-val: Add Vulkan Invocation Sematics check (#4182) 2021-03-16 10:53:37 -04:00
sfricke-samsung a78da3e287 spirv-val: Label VUID 04634 (#4181) 2021-03-16 10:53:27 -04:00
Corentin Wallez 72a12ec0ee Fix -Wextra-semi-stmt -Wsuggest-destructor-override -Wdeprecated-copy-dtor (#4164)
* Fix -Wextra-semi-stmt
* Fix -Wsuggest-destructor-override
* Fix -Wdeprecated-copy-dtor
2021-03-09 13:16:43 +00:00
sfricke-samsung 6ddae36547 spriv-val: Vulkan image gather constant component (#4133) 2021-02-05 15:12:38 -05:00
sfricke-samsung b7a80814e4 spirv-val: Fix/Label UniformConstant VUID (#4134) 2021-02-05 09:57:00 -05:00
sfricke-samsung 21ae83e372 spirv-val: Add Vulkan Invariant Decoration VUID (#4132) 2021-02-05 09:49:14 -05:00
sfricke-samsung ff15cb036c spirv-val: label tests for VUID 04657 (#4119) 2021-02-02 10:54:26 -05:00
sfricke-samsung 7f28532f68 spirv-val: Add Vulkan PSB64 convert VUID (#4122) 2021-02-01 10:39:44 -05:00
Caio Marcelo de Oliveira Filho a936386673 Validate SPV_KHR_workgroup_memory_explicit_layout (#4128)
* Validate SPV_KHR_workgroup_memory_explicit_layout

* Check if SPIR-V is at least 1.4 to use the extension.

* Check if either only Workgroup Blocks or only Workgroup non-Blocks
  are used.

* Check that if more than one Workgroup Block is used, variables are
  decorated with Aliased.

* Check layout decorations for Workgroup Blocks.

* Implicitly use main capability if the ...8BitAccess or
  ...16BitAccess are used.

* Allow 8-bit and 16-bit types when ...8BitAccess and ...16BitAccess
  are used respectively.

* Update SPIRV-Headers dependency

Bump it to include SPV_KHR_workgroup_memory_explicit_layout.

* Add option to validate Workgroup blocks with scalar layout

Validate the equivalent of scalarBlockLayout for Workgroup storage
class Block variables from SPV_KHR_workgroup_memory_explicit_layout.
Add option to the API and command line tool.
2021-01-27 19:38:38 -05:00
sfricke-samsung 85dd3ccc82 spirv-val: Add Vulkan image gather offset VUID (#4118) 2021-01-27 19:37:45 -05:00
sfricke-samsung f41191b61b spirv-val: Label Vulkan atomic semantics VUIDs (#4120) 2021-01-25 11:19:06 -05:00
sfricke-samsung 142321c07b spirv-val: Label VUID 04662 (#4123) 2021-01-25 09:51:21 -05:00
sfricke-samsung 73d0ab39bf spirv-val: Label VUID 04683 (#4121) 2021-01-25 09:38:19 -05:00
sfricke-samsung 5e1b362107 spirv-val: Add Vulkan EXT builtins (#4115) 2021-01-20 10:40:31 -05:00
sfricke-samsung a8c4255195 spirv-val: Add Vulkan Memory Scope VUs (#4106)
* Fix test using Fragment execution
2021-01-19 08:37:42 -05:00
sfricke-samsung de68721119 spirv-val: Add Vulkan Addressing Model check (#4107) 2021-01-15 09:35:17 -05:00
Ryan Harrison 69f4c8afde 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 6b17b537c6 spirv-val: Vulkan atomic storage class (#4079)
* spirv-val: Vulkan atomic storage class

* Add PhysicalStorageBuffer
2021-01-14 09:41:18 -05:00
sfricke-samsung b2b632120b spirv-val: Label standalone Vulkan VUID (#4091) 2021-01-07 09:00:05 -05:00