Commit Graph

335 Commits

Author SHA1 Message Date
Ehsan
5fb83a9708
Allow NonWritable to target struct members. (#2420)
It should be allowed for the NonWritable decoration to be applied to
structure type members.
2019-02-27 16:11:50 -05:00
Jeff Bolz
002ef361ca Add validation for SPV_NV_cooperative_matrix (#2404) 2019-02-25 17:43:11 -05:00
Sarah
fc3897b5f5
Validate: (data) Block can't appear within a Block (#2410)
A Block or BufferBlock cannot be nested within another Block or BufferBlock
2019-02-25 10:37:43 -05:00
Steven Perron
a006cbc1d0
Non memory object as parameters. (#2415)
In relaxed addressing mode, we want to accept non memory objects
because this is a very natural translation of hlsl.  It should be fixed
by legalization by inlining the calls.
2019-02-22 12:51:22 -05:00
Sarah
4c43afcade
It is invalid to apply both Restrict and Aliased to the same <id> (#2408)
to fix #2408 - It is invalid to apply both Restrict and Aliased to the same
2019-02-21 12:03:52 -05:00
Sarah
76730a46a1
In Vulkan, disallow BufferBlock on StorageBuffer variables (#2380)
To fix #2168.
2019-02-20 11:50:57 -05: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
a0ff7c5120
Add better error message to ValidateInstructions (#2365)
Fixes #2364
2019-02-08 11:24:02 -05:00
alan-baker
9b6ba4d1c5
Allow arrayed storage images for NonWritable decoration (#2358)
Fixes #2354

* Storage image pointer registration allows optional level of arraying
* Added a test
2019-02-06 15:20:19 -05:00
alan-baker
117a1fd11f
Validate variable pointer related function call rules (#2270)
Fixes #2105

* Check storage class validity
* Check memory object declaration validity
2019-02-06 14:10:40 -05:00
Ryan Harrison
368567bc51
Convert deprecated GoogleTest fixture to the new version (#2357)
Fixes #2356
2019-02-05 10:33:55 -05:00
Steven Perron
453b7c85c8
Fix up some test (#2351)
I made a mistake merging a PR, and it contained tests that break with
the latest google test.  I've fixed them up.
2019-01-31 16:44:15 -05:00
Ryan Harrison
846d12afed
Add whitelist for decorations in WebGPU (#2346)
Fixes #2273
2019-01-31 16:25:46 -05:00
Ryan Harrison
2acbf488b8
Add WebGPU specific validation for WorkgroupSize BuiltIn decoration (#2334)
Part of resolving #2276
2019-01-30 17:01:17 -05:00
Ryan Harrison
e2f4622627
Add WebGPU specific validation for multiple BuiltIn decorations (#2333)
Covers NumWorkgroups, LocalInvocationId & GlobalInvocationId

Part of resolving #2276
2019-01-30 17:00:58 -05:00
Ryan Harrison
3d2afb78c2
Add whitelist of allowed BuiltIn decorations for WebGPU (#2337)
Part of resolving #2276
2019-01-30 15:46:02 -05:00
Ryan Harrison
d17fcf8abd
Add WebGPU validation for LocalInvocationIndex BuiltIn decoration (#2335)
Part of resolving #2276
2019-01-30 15:45:31 -05:00
Ryan Harrison
837153ccdd
Add WebGPU specific validation for FragDepth BuiltIn decoration (#2332)
Part of resolving #2276
2019-01-30 15:27:04 -05:00
Ryan Harrison
0c14583f15
Add WebGPU specific validation for FragCoord BuiltIn decoration (#2331)
Part of resolving #2276
2019-01-30 14:53:43 -05:00
Ryan Harrison
b6698e0d83
Add WebGPU specific validation for FrontFacing BuiltIn decoration (#2330)
Part of resolving #2276
2019-01-30 14:48:43 -05:00
Ryan Harrison
734def1447
Add WebGPU specific validation for InstanceIndex BuiltIn decoration (#2329)
Part of resolving #2276
2019-01-30 14:20:55 -05:00
Ryan Harrison
b947ecfe79
Add WebGPU specific validation for VertexIndex BuiltIn decoration (#2328)
Part of resolving #2276
2019-01-30 12:22:30 -05:00
Steven Perron
464111eaef
Remove use of deprecated googletest macro (#2286)
* Remove use of deprecated googletest macro

INSTANTIATE_TEST_CASE_P has been deprecated.  We need to use
INSTANTIATE_TEST_SUITE_P instead.

* Remove extra commas from test suites.
2019-01-29 18:56:52 -05:00
Jeff Bolz
7f1a020abc Fix test_val_limits MSVC build (#2347) 2019-01-29 13:29:58 -05:00
Ryan Harrison
5d6b4c4b1b
Move CodeGenerator to be accessible by other validation tests (#2343)
Fixes #2342
2019-01-29 10:27:11 -05:00
David Neto
7f3679a8b6
Validate NonWritable decoration (#2263)
Also permit NonWritable on members of structs used for UBO and SSBO.
(That seems inadvertently removed in recent revisions of the spec.)
2019-01-28 12:44:13 -08:00
alan-baker
cf011f9901 More layout check fixes (#2315)
* check array strides for multidimensional arrays
* check layouts of structs in arrays for multiple indices
* new tests
2019-01-24 14:24:31 -08:00
JasperNV
8915a7c8f1 spirv-val: Emit an error when an OpSwitch target is not an OpLabel (#2298)
Fixes #1628.

* spirv-val: Emit an error when an OpBranch target is not an OpLabel
2019-01-24 12:11:49 -05:00
Ryan Harrison
1e3c589a6d
Add WebGPU specific validation for Position BuiltIn decoration (#2309)
This CL adds in the specific checks required for WebGPU, enables
running the builtin checks for WebGPU, and refactors the existing
testing infrastructure to support testing the new checks.

This PR is part of resolving #2276
2019-01-24 12:08:25 -05:00
Ryan Harrison
b1be6763f6
Add helper for 'is Vulkan or WebGPU' (#2324)
Fixes #2323
2019-01-23 13:07:03 -05:00
David Neto
4a405eda53
Fix layout checks for nested struct in relaxed layout; and descriptor arrays (#2312)
* Fixed layout checks for nested structures

Fixes #2303

* Incoming offsets accumulate through nested structures

* Check layouts through arrays

* Perform layout checks in the presence of descriptor arrays (and
runtime arrays)

* Fix formatting
2019-01-22 15:15:24 -08:00
Ryan Harrison
3a3ad2ec50
Add utility to generate a logging string for a given environment (#2314)
Fixes #2313
2019-01-22 15:18:14 -05:00
Steven Perron
eab06d669e
Check forward reference in OpTypeArray. (#2307)
In a recent PR, we allowed a forward reference for the element type in
an array declaration.  However, we do not have other check to make sure
the forward reference is a pointer type first reference in
OpTypeForawrdPointer.  We add that check.

Fixes https://crbug.com/920074.
2019-01-21 12:10:25 -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
b6150e5170
Add WebGPU specific RTA validation rules (#2287)
Fixes #2066
2019-01-17 10:39:12 -05:00
David Neto
70404a96ab
Fix leaks in tests (#2295)
Generally, a test fixture in a method that can generate a binary
should release any previously cached binary.  Similarly for diagnostics.
2019-01-16 16:53:10 -05:00
Ryan Harrison
3109ca16b0 Add tests to validate allowed lengths of int and floats for WebGPU (#2289)
Fixes #2277
2019-01-16 11:24:48 -05:00
Ryan Harrison
cb27ffdcd8
Ensure that required storage classes have initializer for WebGPU (#2285)
Fixes #2279
2019-01-15 10:24:58 -05:00
Ryan Harrison
9d8534e329
Enforce rules for OpTypeRuntimeArray on Vulkan (#2191)
Fixes #1936
2019-01-14 16:44:44 -05:00
Ryan Harrison
16a0da370b
Ensure that entry point names are unique for WebGPU (#2281)
Fixes #2275
2019-01-14 13:52:28 -05:00
David Neto
6958d11bc2
Validate decorations from SPV_KHR_no_integer_wrap (#2271)
Validates NoSignedWrap, NoUnsignedWrap.

We are permissive by allowing any extended instruction.
2019-01-09 10:36:17 -05:00
David Neto
df5bd2d05a
Permit UConvert spec-constant op for SPV_AMD_gpu_shader_int16 (#2264)
See https://github.com/KhronosGroup/glslang/issues/848
2019-01-08 19:00:18 -05:00
Jeff Bolz
5eab6df648 SPV_EXT_physical_storage_buffer (#2267) 2019-01-07 13:19:24 -05:00
David Neto
a87d3ce48e
Validate operation for OpSpecConstantOp (#2260) 2019-01-03 14:28:00 -05:00
alan-baker
a900bacb58 Broader check for ids that require a type (#2259)
Broader check for ids that require a type

Fixes https://crbug.com/911700

* Adds a broader check for when id operands require a type
* updated a few tests
* added a test to catch the original issue
2019-01-03 13:55:43 -05:00
kholtnv
980ae1d1cd Added NVIDIA ray tracing storage classes in ValidateVariable. (#2254)
* Added additional changes for the new AccelerationStructureNV type.

* Added NVIDIA ray tracing storage classes for checking in ValidateVariable.

* For NVIDIA ray tracing storage classes added test to load bool type (allowed) in new storage class.
2018-12-27 15:08:11 -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
Alejandro Lopez
de797ddcb5 Check that certain decorations cannot be used more than once and/or are mutually exclusive (#2171)
Fixes #1636

* Add a hash functor for decoration types for c++11 compliance
* Change non-POD static variables and add test for Block+BufferBlock
2018-12-07 12:46:27 -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