1501 Commits

Author SHA1 Message Date
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
baldurk
a972e73ad7 Add option to reflect all block members, inactive or active.
* The stages mask is more fine-grained, and each variable or block's mask
  indicates which stages it's active in.
2019-02-04 12:02:59 +00:00
baldurk
657acc0c40 Add option to reflect buffer blocks & variables separately to uniforms
* Also note the uniform indices of atomic counter buffers
2019-02-04 12:02:59 +00:00
baldurk
4a2aa82236 Reflect array stride, top-level array stride, and block member count 2019-02-04 12:02:59 +00:00
baldurk
0af5e3e346 Reflect pipeline outputs as well as inputs, optionally from other stages
* We add an option to reflect inputs from other stages than vertex, if only a
  later subset of the stages is linked into the program.
2019-02-04 12:02:59 +00:00
baldurk
edf8212ab8 Add an option to report array variables with trailing [0] suffix
* This is as expected by ARB_program_interface_query
2019-02-04 11:21:09 +00:00
baldurk
15c37f79a9 Include array index in reflected uniform names more consistently
* This comes from the resolution of issues 4, 5 & 6 in
  ARB_program_interface_query, stating that uniform buffers should have their
  members expanded out as normal and arrays should have elements added.
* If a buffer block has a large array e.g. [10000] we don't want to iterate over
  every array element. Instead we should only expand out the first [0] element,
  then expand as normal from there.
* The array name should still be appended with [0] to indicate that it's an
  array.
2019-02-04 11:21:09 +00:00
John Kessenich
9983f99e87
Merge pull request #1687 from Igalia/apinheiro/no-more-struct-member-offsets
ParseHelper: don't assign xfb_offset for struct members
2019-02-03 23:22:21 +07:00
Rex Xu
eaf31ab98c Add 8-bit/16-bit transform feedback support for future use 2019-02-03 23:31:32 +08:00
John Kessenich
de3b8e3bf3 Fix #1682: flesh out more vulkan/SPV ModuleProcessed 2019-02-01 04:09:38 -07:00
Alejandro Piñeiro
0f66082d1d ParseHelper: don't assign xfb_offset for struct members
This commit undoes the code on the commit "ParseHelper: assign
xfb_offset for struct members too" (commit
af8c1bdb161e4b2ddf019b61bdfca61f84cb1ca8), except the method renaming,
and updates the tests.

During the review of the implementation of Vulkan extension
VK_EXT_transform_feedback for the Linux Intel driver, it was pointed
that the Vulkan environment spec for SPIR-V only ever refers to block
or block members being decorated. It would be strange to not do the
same for OpenGL (ARB_gl_spirv). That would also fit better to what
GLSL does, where setting explicit xfb offsets for struct members is
not allowed.

FWIW, the original patch was proposed based on the fact that
ARB_gl_spirv is relying on OpenGL for how xfb offsets should be
assigned to members, and it was not clear (at least to me) which is
the responsible of such.
2019-01-31 17:09:30 +01:00
John Kessenich
c9e03360e2
Merge pull request #1675 from nicebyte/ext_yuv_target
Add support for GL_EXT_YUV_target
2019-01-29 19:03:11 -08:00
nicebyte
c28369b75f Add support for GL_EXT_YUV_target 2019-01-29 13:17:47 -08:00
baldurk
90995f5dae Update reflection offset consistently for structure members
* Previously the offset was only updated with EOpIndexDirectStruct, but we also
  need to update it for the other index types into arrays, and when expanding an
  aggregate reached after dereferencing.
2019-01-29 17:00:53 +00:00
John Kessenich
544c039d26 HLSL: Fix #1679: Add HLSL earlydepthstencil -> SPV EarlyFragmentTests. 2019-01-28 22:19:43 -07:00
Jeff Bolz
e135a4897a More precisely check for the qualifiers that enable the vulkan memory model for buffer references.
Not all memory qualifiers necessarily need the vulkan memory model, e.g. volatile/restrict that correspond to core SPIR-V features do not.
2019-01-20 00:59:38 -06:00
Rex Xu
75c5603ada Fix xfb_stride incorrectness(#1654)
Add int64 support in XFB. Change containsDouble to contains64BitType. Make
it more general.
2019-01-14 12:02:58 +08:00
David Neto
c4d5ac6bfa Update SPIRV-Tools known good: relax Uconvert check
Permit UConvert as an OpSpecConstantOp operation when
SPV_AMD_gpu_shader_int_16 is used.
2019-01-09 10:32:32 -05:00
John Kessenich
69932ab47f
Merge pull request #1645 from KhronosGroup/dupe-accelstruct
Don't output duplicate OpTypeAccelerationStructureNV declarations
2019-01-08 09:39:32 +07:00
Piers Daniell
3cf3f96292 Don't output duplicate TypeAccelerationStructureNV declarations 2019-01-07 14:17:44 -07:00