3183 Commits

Author SHA1 Message Date
Greg Fischer
9d92945df3 Update spirv-tools known-good 2019-03-27 11:43:03 -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
John Kessenich
5125eb58db
Merge pull request #1741 from dgkoch/shader_subgroup
Enable GL_KHR_shader_subgroup properly
2019-03-27 13:41:47 +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
John Kessenich
5efb004d59
Merge pull request #1711 from demett-brcm/avoid-undefined-behaviour
Avoid undefined behaviour
2019-03-19 14:40:21 +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
bd0f5ad278
Merge pull request #1733 from null77/fix-msvc-warn
Suppress MSVC warning about unused variable.
2019-03-18 23:41:27 +07:00
John Kessenich
49dff5bf9a
Merge pull request #1731 from godlikepanos/master
Avoid running the validator as part of the optimization pass.
2019-03-18 23:38:27 +07:00
Jamie Madill
099a80dd76 Suppress MSVC warning about unused variable.
One variable was only used in an 'assert' call. MSVC flagged this
as unused in Release. Suppress the warning and also add a static
cast to void so the variable becomes referenced.
2019-03-18 11:38:53 -04:00
Panagiotis Christopoulos Charitos
35aeb042a2 Avoid running the validator as part of the optimization pass.
The spvtools::Optimizer::Run method glslang is using constructs a default set
of spvtools::OptimizerOptions. This default set of options instructs the
validator to run. That is not quite correct since glslang will invoke the
validator _explicitly_ after the optimization pass.

Change-Id: I30f458304c6e7f81e89fc4ebd25eabbbd8348063
2019-03-18 11:34:17 +01:00
John Kessenich
b184e41a06 Build: Update to the most recent SPIR-V headers, for Rev. 7 of SPV 1.3 2019-03-17 22:29:25 -06: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
John Kessenich
f925eefb21
Merge pull request #1724 from zoddicus/roll_spirv
Update SPIRV-Tools and Headers
2019-03-13 00:16:57 +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
John Kessenich
437a552f51
Merge pull request #1723 from null77/gn-val-executable
GN: Make glslang_validator an executable.
2019-03-12 11:33:26 +07:00
Jamie Madill
e880e96f4d GN: Make glslang_validator an executable.
The target was accidentally listed as a source_set.
2019-03-11 15:45:31 -04:00
John Kessenich
40c16ec0b3
Merge pull request #1717 from jeffbolznv/getBufferReferenceAlignment
Move getBufferReferenceAlignment to be a method of TType
untagged-3b4adc8786f8261f953a
2019-03-07 11:05:08 +07:00
John Kessenich
839a948169
Merge pull request #1716 from jeffbolznv/buffer_reference_fold2
Improved fix for buffer reference constants
2019-03-07 11:04:26 +07:00
Jeff Bolz
7895e473c3 Move getBufferReferenceAlignment to be a method of TType
This is a better place for it logically, since it is not specific to
glsl->spirv translation. And in a future change I want to use it outside
of glslangtospv.
2019-03-06 13:40:33 -06: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
John Kessenich
79d25ea0ce
Merge pull request #1714 from jeffbolznv/volatil
Fix interactions between 'volatile' and the Vulkan memory model
2019-03-06 20:43:07 +07:00
John Kessenich
cc4a756d48 Build: Update to latest SPIR-V header. 2019-03-06 11:21:38 +07: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
John Kessenich
9390154c55
Merge pull request #1699 from jeffbolznv/buffer_reference_fold
Handle buffer references vs 'const'
2019-03-04 13:41:27 -07: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
John Kessenich
d90d548161
Merge pull request #1713 from jeffbolznv/fix_nv_extension_disabled
Fix NV_EXTENSIONS-disabled build
2019-02-28 14:47:04 -05:00
Jeff Bolz
1994fe4523 Fix NV_EXTENSIONS-disabled build 2019-02-28 11:59:35 -06:00
John Kessenich
822817977c
Merge pull request #1701 from jeffbolznv/cooperative_matrix
Implement GL_NV_cooperative_matrix
2019-02-26 21:27:09 +07:00
Jeff Bolz
4605e2ed2b Implement GL_NV_cooperative_matrix 2019-02-25 23:42:59 -06:00
David Emett
0b01841926 Avoid undefined behaviour 2019-02-25 19:16:47 +00:00
John Kessenich
ec484527b6
Merge pull request #1709 from KhronosGroup/fix-pp
PP: Fix #1605: Paste tokens for ## through number->letter transitions.
2019-02-23 01:09:17 +07:00
John Kessenich
a84079dcf3 PP: Fix #1605: Paste tokens for ## through number->letter transitions. 2019-02-22 08:54:38 -07:00
John Kessenich
a51d3d9f22
Merge pull request #1706 from nico/master
Fix -Wextra-semi warnings in headers used in Chromium
2019-02-21 23:46:27 +07:00
John Kessenich
b0f4b427d5
Merge pull request #1705 from baldurk/fix-indexindirect-reflection
Fix type recursion with EOpIndexIndirect dereferences
2019-02-21 23:43:59 +07:00
Nico Weber
76577b1aec Fix -Wextra-semi warnings in headers used in Chromium 2019-02-21 11:05:21 -05: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
5432f0dd8f
Merge pull request #1702 from greg-lunarg/kg101
Update SPIRV-Tools known good
2019-02-21 13:36:31 +07:00
John Kessenich
17a8d9ad00
Merge pull request #1703 from dj2/mem_leak
Allocate empty function name in the string pool.
2019-02-21 13:10:18 +07:00
John Kessenich
ade579fbc5
Merge pull request #1704 from dj2/leak
Fixup leak of TString
2019-02-21 13:09:30 +07:00
Dan Sinclair
0560138e66 Fixup leak of TString
In decomposeIntrinsic a new TString was being allocated and passed into
a TVariable. That string was leaking. This CL converts the new TString
to call NewPoolTString to allocate from the TString pool.
2019-02-20 16:40:13 -05:00
Dan Sinclair
756bfd0ad1 Allocate empty function name in the string pool.
Inside the grammar for function_identifier if the .function is null an
empty function name is allocated. This is allocated on the stack and
passed into TFunction as a pointer. TFunction just stores that pointer.

Later, when we access the name we will receive an invalid usage of a
stack allocated variable. This CL switches to using NewPoolTStringn for
the empty function name.
2019-02-20 16:32:49 -05:00
Greg Fischer
f8939eff7a Update SPIRV-Tools known good 2019-02-20 13:17:09 -07:00
John Kessenich
58d6905ea0
Merge pull request #1700 from KhronosGroup/fix-pp
PP: Remove sub-tokens in macro recording and record spaces correctly.
2019-02-19 23:57:06 +07:00
John Kessenich
6225dd4ba1 PP: Faithfully track white-space through macro record/use, fixing bugs:
This fixes the comparison in macro body redefinitions, where initial
white-space differences do not matter, but internal white-space differences
do matter.
2019-02-19 07:26:54 -07:00
John Kessenich
5cdf3c5a23 PP: Non-functional: Remove the sub-tokenization of macro stream record.
This has been a continually fragile area. Switching to a vector of real
objects, instead of a linearized stream of characters, removes a bunch of
code and generally makes this area more robust.
2019-02-19 07:26:36 -07:00
John Kessenich
bce1f51096 Build: Fix #1640: Change strcpy to snprintf. 2019-02-18 22:25:58 -07: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