1520 Commits

Author SHA1 Message Date
Daniel Koch
2cb2f197a7 Add support for GL_NV_shader_sm_builtins
Including spirv and AST tests

Also increase size of TBuiltInVariable bitfields since we've now exceeded 127
and add a static_assert to make this easier to find next time it happens!
2019-06-08 08:53:11 -04:00
John Kessenich
92b5c9ee91 GLSL: Revert f6873f7 to fix #1764. 2019-06-08 04:30:46 -06:00
Jeff Bolz
fd556e32b3 Use spvValidatorOptionsSetBeforeHlslLegalization for pre-legalized HLSL 2019-06-07 14:42:08 -05:00
Jeff Bolz
c6f0ce8dbc Support GL_ARB_fragment_shader_interlock 2019-06-03 11:55:25 -05:00
Daniel Koch
593a4e0aa5 Fix subgroup support for ray tracing
Closes #1735

GlslangToSpv.cpp
- minor formatting cleanup

BaseTypes.h
- minor formatting cleanup
- add subgroup builtins to GetBuiltInVariableString
  (was resulting in "unknown built-in variable" messages in test output)

Initialize.cpp
- better naming and re-use of strings for subgroup builtin variable declarations
- define subgroup builtin variables in ray-tracing shaders

intermOut.cpp
- add handling of the EOpSubgroupParition* variables
  (was resulting in "ERROR: Bad aggregation op" messages in test output)

Update test results.
2019-05-31 14:17:36 -04:00
Daniel Koch
c3e60ad9b6 Add AST tests for ray tracing shaders
with subgroup touch tests (error and non-error cases)
Currently the subgroup built-ins are NOT giving the correct output.
This is fixed in the next commit.
2019-05-31 14:17:22 -04:00
Daniel Koch
3418cb4c98 Add AST tests for mesh and task shaders
with subgroup touch testing (error and non-error cases)

Add missing symbolTable.relateToOperator("subgroupMemoryBarrierShared") call for
Mesh/Task shaders so they don't assert in ParseHelper.cpp
2019-05-31 14:17:13 -04:00
Daniel Koch
51760c88ca Add more subgroup testing
Touch test all subgroup builtins in vert, tesc, tese, geom, frag, compute shaders
before and after enabling extensions to make sure the correct errors are generated
and then not generated (after enablement).
2019-05-31 14:16:52 -04:00
Jeff Bolz
8adc2f565e Allow runtime-sized arrays of acceleration structures 2019-05-30 12:45:15 -05:00
Daniel Koch
40b1a9e14e Fix include guard for GL_EXT_multiview 2019-05-28 15:23:19 -04:00
Daniel Koch
9bb17cd0eb Return consistent names from CapabilityString
Don't prefix with "Capability" since the majority of them don't.
Also add missing CapabilityImageFootprintNV
2019-05-28 15:23:10 -04:00
David Neto
8b920c793a Update SPIRV-Tools, SPIRV-Headers
Headers update fixes validation of spv.shaderBallotAMD.
2019-05-16 02:59:54 -04:00
John Kessenich
b64952eddd SPV 1.4: Move to 1.4 validation, removing all 1.4 validation failures. 2019-05-10 00:02:45 -06:00
John Kessenich
f43c739ac5 SPV 1.4: Emit SignExtend and ZeroExtend for integer image reads/writes. 2019-05-10 00:02:45 -06:00
John Kessenich
61a5ce190a SPV 1.4: Lookup tables: Use variable initializer and NonWritable...
...when doing a variable lookup on an array of constants.
2019-05-10 00:02:45 -06:00
John Kessenich
fbb6bdf046 SPV 1.4: Add support for OpCopyLogical, careful of Boolean differences. 2019-05-10 00:02:45 -06:00
John Kessenich
1f4d04687b SPV 1.4: Implement the 5 new loop controls. 2019-05-10 00:02:45 -06:00
John Kessenich
0c1e71a123 SPV 1.4: Use OpSelect for trivial typed non-scalar/vector expressions. 2019-05-10 00:02:45 -06:00
John Kessenich
cfea59d357 SPV 1.4: Add testing infrastructure for SPV 1.4 tests.
This includes the test for the first feature of OpEntryPoint.
2019-05-10 00:02:45 -06:00
Jeff Bolz
88220d507e For nonuniformEXT constructor, make a copy of the node to decorate 2019-05-08 10:24:46 -05:00
John Kessenich
e291f7a09f
Merge pull request #1739 from jeffbolznv/buffer_reference2
Add support for GL_EXT_buffer_reference2
2019-05-08 17:12:52 +07:00
John Kessenich
c0640dabfd
Merge pull request #1758 from jeffbolznv/convertonly
If a shader's only use of float16 is for FConvert, add the Float16 capability
2019-05-03 21:44:41 +07:00
John Kessenich
5cb2fa2ad2 Fix #1759: Check for specialization constants when literals required. 2019-05-03 08:40:35 -06:00
Jeff Bolz
758c93364c Add support for GL_EXT_buffer_reference2 2019-05-01 16:13:26 -05:00
Jeff Bolz
faac86e5d6 If a shader's only use of float16 is for FConvert, add the Float16 capability.
When visiting instructions, check that there are no 16-bit storage capabilities
and add the Float16 capability. Same for int8/int16.
2019-05-01 11:45:51 -05:00
John Kessenich
f6873f7e49 GLSL: Add error check for an argument dropping the 'restrict' qualifier 2019-04-19 04:57:43 -06:00
John Kessenich
08d61df040 Fix #1720: Give an error for parameter mismatched image format. 2019-04-19 04:51:07 -06:00
John Kessenich
137e071ca4
Merge pull request #1740 from ewerness-nv/callableincoming
Callables shouldn't have incoming ray flags
2019-03-27 16:19:05 +07:00
Daniel Koch
83170e3f7a Enable GL_KHR_shader_subgroup properly
(and GL_NV_shader_subgroup_partitioned) based on GL/ES version
instead of predicating it on vulkan SPV generation

Also add AST testing.
The glsl.450.subgroup* files are largely the same as the spv.subgroup*
The glsl.es320.subgroup* files are the same as the 450 versions, but modified to be ES compatible.
2019-03-26 13:45:33 -04:00
Eric Werness
659060b90a Callables shouldn't have incoming ray flags 2019-03-25 17:09:13 -07:00
Laurie
e442a03897 GLSL: Fix tessellation control shader bounding box support. (#1730)
Prior to this change, OES_primitive_bounding_box and EXT_primitive_bounding_box were both recognised as extensions, but only the name gl_BoundingBoxOES could be used. However the EXT version uses the name gl_BoundingBoxEXT instead. In addition, since GLES 3.2, the extension has been included in the core standard and the name gl_BoundingBox may be used instead. This change aims to make both extensions and the 3.2 core version all work.
2019-03-19 08:49:27 +07:00
John Kessenich
80c36be4a9
Merge pull request #1728 from alelenv/shaderrecord_fix
Error out writes to shaderRecordNV buffer blocks.
2019-03-17 13:00:27 +07:00
Ryan Harrison
938ab9a6e5 Update SPIRV-Tools and Headers
Also mark spv.subgroupPartitioned as passing validation.
2019-03-12 11:25:00 -04:00
Jeff Bolz
3fd1232665 Improved fix for buffer reference constants
This is an alternate fix for the issue described in commit be63facd, whose
solution didn't work if there were non-trivial operations involved in computing
a constant initializer which caused the 'constant unfolding' code to kick in
(addConstantReferenceConversion). Instead, this change does the 'unfolding'
later in createSpvConstantFromConstUnionArray. If a reference-type constant has
survived that long, then folding is already done, this must be a 'real' (inside
a function) use of the constant, and it should be safe to unfold and apply the
bitcast.
2019-03-06 09:28:29 -06:00
Jeff Bolz
38cbad15ca Fix interactions between 'volatile' and the Vulkan memory model
Last year we changed 'volatile' to also act as 'coherent', but when I
resolved the memory model changes against that change I missed handling
volatile in a couple places that we check for coherent. There was also
a place in post-processing that acted as if the volatile memory access
flag has a literal number associated with it, when it doesn't.
2019-03-05 14:40:07 -06:00
Ashwin Lele
afa5671fef Error out writes to shaderRecordNV buffer blocks. 2019-03-04 11:05:55 -08:00
Jeff Bolz
be63facd80 Handle buffer references vs 'const'
Allow constructors to and from references to be constant folded. Section 4.3.3
says constructors whose arguments are all constant expressions must fold.

Disallow 'const' on buffer reference types. It is not a 'non-void transparent
basic data type' (it is not considered 'basic').

Handle buffer reference constants (which can be assigned to a non-const reference,
or can be further folded to another type of constant) by converting to
'constructor(uint64_t constant)' in addConversion.

Disallow == and != operators on reference types.
2019-03-04 12:46:11 -06:00
Jeff Bolz
4605e2ed2b Implement GL_NV_cooperative_matrix 2019-02-25 23:42:59 -06:00
John Kessenich
a84079dcf3 PP: Fix #1605: Paste tokens for ## through number->letter transitions. 2019-02-22 08:54:38 -07:00
baldurk
141bc5a54f Fix type recursion with EOpIndexIndirect dereferences
* This primarily affects arrays-of-arrays but it can also affect arrays-of-
  structs if there are no further dereferences.
2019-02-21 12:52:05 +00:00
John Kessenich
9f538c7207
Merge pull request #1696 from baldurk/fix-nonblock-array-size
Fix treatment of array input/output variables in reflection
2019-02-17 13:15:11 +07:00
John Kessenich
6fee94460f PP: Fix #1694: Rationalize errors on partially expanded macro argument. 2019-02-16 07:35:13 -07:00
Sahil Parmar
9466850f54 Update gtest to explicitly size gl_PrimitiveIndicesNV[] 2019-02-12 12:27:21 -08:00
Sahil Parmar
ab027bef3d Fix resizing of gl_PrimitiveIndicesNV[] to max_primitives*geomSize
- This change also allows redeclaration of gl_PrimitiveIndicesNV and
  adds error checks against incorrect explicit array size.
- Also modifies gtests to check array bound limits and redeclare gl_PrimitiveIndicesNV[].
2019-02-11 15:15:33 -08:00
baldurk
879562b766 Fix treatment of array input/output variables in reflection
* Non-block arrays should not be ignored when exploding types.
* When not exploding, set the array size correctly on each item.
2019-02-11 16:39:12 +00:00
baldurk
1905069857 Add option to unwrap I/O block aggregates in reflection
* We follow similar rules to uniform block exploding.
2019-02-11 11:53:52 +00:00
John Kessenich
9840f11f85 PP: Fix #1694: Handle badly formed argument substitution.
Also added a warning for no space after a macro name.
2019-02-11 03:05:00 -07:00
John Kessenich
d83344fc4e
Merge pull request #1684 from baldurk/reflection-interface-improve
Opt-in improvements to reflection interface
2019-02-09 12:59:30 +07:00
Sahil Parmar
3958927a59 Add missing support for gl_MeshViewCountNV/gl_MeshViewIndicesNV in task shaders 2019-02-07 14:28:12 -08:00
Alan Baker
aeeaf08f02 Update expected test results 2019-02-06 14:18:19 -05:00