Commit Graph

563 Commits

Author SHA1 Message Date
Spencer Fricke
8422d8a44b
spirv-val: Label ShaderRecordBufferKHR VUID (#4926) 2022-09-16 14:05:23 -04:00
Spencer Fricke
59cf5b1346
spirv-val: consider OpEmitMeshTasksEXT a terminator instruction (#4923) 2022-09-07 15:12:07 -04:00
Steven Perron
529955e03d
Improve time to build dominators (#4916)
Changed a couple small parts of the algorithm to reduce time to build
the dominator trees.  There should be no visible changes.

Add a depth first search algorithm that does not run a function on
backedges.  The check if an edge is a back edge is time consuming, and
pointless if the function run on it is a nop.
2022-09-02 16:27:10 +00: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
Spencer Fricke
fca39d5cb4
spirv-val: Better message for using OpTypeBool in input/output (#4901) 2022-08-29 12:47:16 -04:00
Spencer Fricke
66bdbacc9c
spirv-val: Use lookup table for Decoration string (#4903) 2022-08-29 11:09:20 -04:00
Spencer Fricke
f76431cbaf
spirv-val: Add SPV_KHR_ray_tracing storage class (#4868)
* Added VUID labels
2022-08-29 11:09:06 -04:00
Spencer Fricke
3c1a14b2b6
spirv-val: SBT Index for OpExecuteCallableKHR (#4900) 2022-08-18 13:42:25 -04:00
Spencer Fricke
0073a1fa36
spirv-val: Remove ImageWrite Texel todo (#4899) 2022-08-17 11:37:05 -04:00
Spencer Fricke
f20e8d05f5
spirv-val: Add SPV_KHR_ray_tracing instructions (#4871) 2022-08-08 14:45:04 -04:00
Spencer Fricke
08c542d344
spirv-val: Label VUID 06997 (#4881) 2022-08-03 10:42:13 -04:00
alan-baker
b5d0bf285f
Require ColMajor or RowMajor for matrices (#4878)
Fixes #4875

* Require that matrices in laid out structs have RowMajor or ColMajor
  set as per SPIR-V section 2.16.2 (shader validation)
2022-07-29 15:08:48 -04:00
alan-baker
4773879b68
Update structure layout validation (#4876)
* Uniform block layout rules for matrices should use extended layouts by
  default
2022-07-29 10:16:54 -04:00
Spencer Fricke
cc5fca057e
spirv-val: Fix Vulkan memory scope (#4869) 2022-07-26 15:14:21 -04:00
Spencer Fricke
e4cfa190df
spirv-val: Add SPV_KHR_ray_query (#4848) 2022-07-20 10:12:58 -04:00
Pankaj Mistry
60615b8ec6
Implement SPV_NV_bindless_texture related changes (#4847)
* Add validation for SPV_NV_bindless_texture
2022-07-19 14:41:19 -04:00
Spencer Fricke
93ebf698a0
spirv-val: Add OpConvertUToAccelerationStructureKHR (#4838) 2022-07-15 09:55:33 -04:00
Spencer Fricke
e2cf769302
spirv-val: Label VUID 06925 (#4852) 2022-07-13 10:05:52 -04:00
Spencer Fricke
bc5c8760af
spirv-val: Add Vulkan decoration interface (#4831) 2022-07-07 13:03:52 -04:00
alan-baker
05de650371
Use structural reachability in CFG checks (#4849)
Fixes https://crbug.com/oss-fuzz48578

* Adds structural reachability to basic blocks
  * calculated in same manner as reachability, but using structural
    successors
* Change structured CFG validation to use structural reachability
  instead of reachability
* Fix some invalid reducer cases
2022-07-06 17:43:32 -04:00
David Neto
dcee3a5de0
Update validator diagnostics with "structurally dominated" (#4844)
The updated rules in SPIR-V 1.6 Rev2 use structural dominance,
so update the messages to match
2022-07-06 15:10:29 -04:00
alan-baker
8ec4a0772b
Fix unreachable loop increment (#4836)
* ANGLE builds with -Werror,-Wunreachable-code-loop-increment which had
  a problem with grabbing the first construct in a loop
  * Change the code to just use begin instead
2022-06-30 13:52:50 -04:00
alan-baker
286e9c1187
Use structural dominance to validate cfg (#4832)
* Structural dominance introduced in SPIR-V 1.6 rev2
* Changes the structured cfg validation to use structural dominance
  * structural dominance is based on a cfg where merge and continue
    declarations are counted as graph edges
* Basic blocks now track structural predecessors and structural
  successors
* Add validation for entry into a loop
* Fixed an issue with inlining a single block loop
  * The continue target needs to be moved to the latch block
* Simplify the calculation of structured exits
  * no longer requires block depth
* Update many invalid tests
2022-06-29 23:32:20 -04:00
Steven Perron
66d88508dd
Build struct order only for the section needed when unrolling. (#4830)
We currently build the structured order for all nodes reachable from the
loop header when unrolling a loop.  However, unrolling only needs the
nodes in the loop and possibly the merge node.

To avoid needless computation, I have implemented a search that will
stop at the merge node.

Fixes #4827
2022-06-29 09:53:26 -04:00
Steven Perron
76fe352190
Fail validation when RelaxedPrecision is applied to a type. (#4823)
* Fail validation when RelaxedPrecision is applied to a type.

Fixes #4723
Fixes #4725

* Fixup invalid test
2022-06-21 19:59:01 +00:00
Spencer Fricke
bfc611b03e
spirv-val: Label 06807 and 06808 VUID (#4817) 2022-06-15 11:25:16 -04:00
Junda Liu
044ff1aabf
spirv-val: Add support for SPV_AMD_shader_early_and_late_fragment_tests (#4812)
- Update SPIR-V headers.
- Add validator support.
- Add validator tests.
2022-06-08 08:36:32 -04:00
Shahbaz Youssefi
c94501352d
spirv-val: Optimize struct field decoration lookup (#4809)
A std::set is used instead of std::vector, where the elements are
ordered by member index first.  Decorations for fields are now looked up
by going over the range of decorations for the member only, instead of
the whole set.

In an ANGLE test that generates a struct with 4096 members, validation
goes down from ~140ms to ~90ms.  On debug builds, the difference is more
pronounced, going down from ~2.5s to ~600ms.
2022-06-02 11:32:38 -04:00
Spencer Fricke
82d91083cb
spirv-val: Add PerVertexKHR (#4807) 2022-05-26 13:11:05 -04:00
stu-s
c267127846
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
9e377b0f97
spirv-val: Add CullMaskKHR support (#4792)
Co-authored-by: sfricke-samsung <s.fricke@samsung.com>
2022-05-06 07:32:56 -04:00
Kévin Petit
7014be600c
Add support for SPV_KHR_subgroup_rotate (#4786)
- Add assembler/disassembler support
- Add validator support

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Change-Id: Iffcedd5d5e636a0e128a5906ffe634dd85727de1
2022-05-05 08:58:05 -04:00
Steven Perron
58dc37ea6a
Add SpvBuiltInCullMaskKHR to a switch (#4790)
Add SpvBuiltInCullMaskKHR to a switch so spirv-tools can compile with
the latest headers.
2022-05-03 14:39:51 -04:00
sfricke-samsung
fa5d424830
spirv-val: Add more Vulkan VUID labels (#4764) 2022-03-25 09:29:19 -04:00
sfricke-samsung
90728d2dff
spirv-val: Clean up VariablePointers logic (#4755) 2022-03-24 12:02:29 -04:00
Roy.li
cab0b7715a
Use types have same widths in loop condition. (#4763) 2022-03-24 14:07:22 +00:00
sfricke-samsung
b3c1790632
spirv-val: Add Vulkan 32-bit bit op Base (#4758) 2022-03-23 13:55:42 -04:00
sfricke-samsung
9668d2e4e4
spirv-val: Label and add test for PSB Aligned (#4756) 2022-03-23 11:08:21 -04:00
sfricke-samsung
0ab57c2c42
spirv-val: Small Cleanup of validate image (#4752) 2022-03-14 11:08:47 -04:00
sfricke-samsung
7963fa13c7
spirv-val: Add Vulkan Dref not allowed 3D dim VUID (#4751) 2022-03-10 13:08:26 -05:00
sfricke-samsung
5c9d55a59a
spirv-val: Add Vulkan Image VUID 06214 (#4750) 2022-03-10 13:06:48 -05:00
sfricke-samsung
9700708570
spirv-val: Label Vulkan RuntimeArray VUID (#4749) 2022-03-10 13:05:26 -05:00
sfricke-samsung
ca59914c7a
spirv-val: Disallow array of push constants (#4742) 2022-03-10 12:57:20 -05:00
sfricke-samsung
273d2a45ad
spirv-val: Label VUID 06491 (#4745) 2022-03-07 12:30:05 -05:00
sfricke-samsung
d1addc44b2
spirv-val: Label Vulkan VUID 04734 (#4739) 2022-03-04 10:07:24 -05:00
Jeremy Hayes
598bc6744a
spirv-val: Validate DebugTypeMatrix (#4732) 2022-03-04 08:54:05 -05:00
Greg Fischer
ff91f9449b
[spirv-val] Allow 0 Component Count for DebugTypeArray for Shader (#4706)
Rev 7 of NonSemantic.Shader.DebugInfo.100 was updated to allow zero
component count for for DebugTypeArray to represent runtime array.
2022-02-09 17:58:55 -07:00
alan-baker
20b122b2e0
Fix handling of Nontemporal image operand (#4692)
* Nontemporal image operand shouldn't expect a following operand
2022-01-28 21:12:03 -05: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
6938af7f82
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