Commit Graph

1588 Commits

Author SHA1 Message Date
Andreas Flöjt
cb563e68d2 Add a test for 8- and 16-bit construction. 2019-11-14 14:41:52 +01:00
John Kessenich
18d6b6b63e Tests: Add more test results for the previous generator version bump. 2019-11-03 00:22:47 -06:00
John Kessenich
31c3370d83 Bump up the generator version, which is exposed in SPV test results. 2019-11-02 21:26:40 -06:00
David Neto
8c3d5b4b6c SPIR-V: Aggressively prune unreachable merge, continue target
More aggressively prune unreachable code as follows.
When no control flow edges reach a merge block or continue target:
- delete their contents so that:
  - a merge block becomes OpLabel, then OpUnreachable
  - a continue target becomes OpLabel, then an OpBranch back to the
    loop header
- any basic block which is dominated by such a merge block or continue
  target is removed as well.
- decorations targeting the removed instructions are removed.

Enables the SPIR-V builder post-processing step the GLSLANG_WEB case.
2019-10-29 15:33:54 -04:00
John Kessenich
f8d1d7442b Web: Reclaim more space and make all work w/wo GLSLANG_WEB. 2019-10-23 03:15:55 -06:00
John Kessenich
e5eee8fb03 Web: Add basic atomics for SSBOs. 2019-10-23 00:25:39 -06:00
John Kessenich
3dd1ce5b54 Web: Add SSBOs and a few other missing compute features. 2019-10-23 00:25:39 -06:00
John Kessenich
51ed01c877 Web: Add compute stage. 2019-10-23 00:25:39 -06:00
John Kessenich
61c22e255d Web: Add separate texture/sampler, exclude *CubeArray*.
Looks like will add about 1K compressed size to executable footprint.
2019-10-23 00:25:38 -06:00
Jeff Bolz
016ddee83a Only apply volatile semantics to atomics when using Vulkan Memory Model 2019-10-17 11:22:57 -05:00
Dan Sinclair
3290d38011 Use commandline options instead of ENV variables 2019-10-16 13:08:48 -04:00
Dan Sinclair
3f072e158c Move TARGETDIR as well 2019-10-15 16:47:28 -04:00
Dan Sinclair
167201430d Make runtests configurable.
This CL allows setting the location of glslangValidator and spirv-remap
when calling the runtests script. A test target is added to CMake to
execute runtests and sets the location to the build folder for the two
applications.
2019-10-15 15:21:21 -04:00
John Kessenich
765cee8441 GLSL/SPV: Pre SPIR-V 1.5, subgroupQuadBroadcast index must be constant 2019-10-14 23:08:26 -06:00
John Kessenich
101ca388fb
Merge pull request #1880 from georgeouzou/master
Add support for GL_ARB_explicit_uniform_location
2019-10-12 08:24:11 -06:00
John Kessenich
ee8e9c1522 Fix #1924: Promote SPV_EXT_physical_storage_buffer to KHR when required.
If the semantics that require the KHR form over the EXT form are seen
(OpBitcast between a vector and a pointer) promote the requested extension
from the EXT to the KHR.
2019-10-10 20:54:21 -06:00
John Kessenich
1ff0c181bb Fix #1924: Emit SPV_EXT_physical_storage_buffer, not the KHR form.
The KHR form comes along as part of 1.5, and otherwise should require
another form of request to emit it.
2019-10-10 12:01:13 -06:00
John Kessenich
8a97d38913 HLSL: Fix #1912: add attribute syntax for nonreadable/nonwritable 2019-09-29 19:16:25 -06:00
John Kessenich
2d9b0a3550 HLSL: Fix #1912: add attribute syntax for overriding image formats. 2019-09-28 11:39:15 -06:00
John Kessenich
c2fafea970 GLSL/SPV: Fix #1900: Drop const on literal when doing an object copy. 2019-09-20 06:08:49 -06:00
John Kessenich
90e402f42b SPV_KHR_physical_storage_buffer/SPV: Add GL_EXT_buffer_reference_uvec2
Adds uvec2 <-> reference constructor support.
Switches from EXT to KHR for physical_storage_buffer.
2019-09-18 23:52:36 -06:00
Jeff Bolz
c5b669e04c Add GL_EXT_shader_subgroup_extended_types support 2019-09-17 23:44:27 -05:00
Chow
352e668a6d Add flags for local size values ( compute shader )
Purpose :

According to GLSL SPEC 4.6 ( 4.4.1.4 Compute Shader Inputs), for compute shader input qualifiers, we should declare such qualifiers with same values in the same shader (local_size_x, y and z).
"If such a layout qualifier is declared more than once in the same shader, all those declarations must set the same set of local work-group sizes and set them to the same values; otherwise a compile-time error results."

Why this fix:

If we manually set "local_size_x = 1" and directly following a declaration like "local_size_x = 2", this would not be detected. That is because currently we treat all the '1' as default value and could not restrictly detect whether those are default values.

Test case:
......
layout(local_size_x=1) in;
layout(local_size_x=2) in;
......

So I add test cases for this fix:
1. set local_size_y = 1 => success
2. set local_size_y = 2 => error
3. set local_size_y = 1 => success
2019-09-16 16:39:54 +08:00
John Kessenich
664ad418f8 Fix #1879: Check for valid variable before checking for unsized arrays.
The order of error checking was not quite being correct (maybe there is no correct
ordering, when many checks must be done and they affect each other).
So, check for block-name reuse twice.
2019-09-05 02:30:27 -06:00
John Kessenich
92f5afdee0 Placeholder fix for part of #1870.
Also fixes, in practice, https://github.com/KhronosGroup/GLSL/issues/83.
When the specification language is correctly created, glslang can be
revisited for correctness.  In the meantime, this seems like the best
"bug" to have relative to the specification.

Memory qualifiers are only relevant to parameters when they apply
to what the argument points to, as otherwise the argument is copied.

This leaves the fix from #1870 in place, and then more correctly
ignores memory qualifiers when something will be passed by copy.
2019-08-30 10:06:16 -06:00
John Kessenich
14e13e757d
Merge pull request #1876 from jeffbolznv/imma
GL_NV_integer_cooperative_matrix support
2019-08-28 04:10:00 -06:00
John Kessenich
df1d4ccf5f ESSL/SPV: Fix #1856: Allow ESSL shaders to compile to OpenGL SPIR-V. 2019-08-28 02:51:38 -06:00
baldurk
1f1e5369ce Dereference any array type before expanding root-level SSBO members
If we don't do this then we get reflection output like so:

ArrayedBind[0].a.a: offset 0, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].a.b: offset 4, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b.a: offset 4, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b.b: offset 8, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b: offset 4, type 1406, size 1, index 4, binding -1, stages 1

When the outer reflection loop that calls blowUpActiveAggregate incorrectly iterates over the struct members.
2019-08-26 12:59:38 +01:00
georgeouzou
d2b24ae5d7 Add support for GL_ARB_explicit_uniform_location 2019-08-25 00:16:10 +03:00
Jeff Bolz
387657e4cf GL_NV_integer_cooperative_matrix support 2019-08-22 20:37:59 -05:00
John Kessenich
9a5689f632 GLSL: Inherit memory qualifiers, both declaratively and in execution.
Fixes #1870, probably others.
2019-08-22 08:54:22 -06:00
John Kessenich
369ffa9543 web: Fix accidental additon of refract() prototypes and update README. 2019-08-21 07:54:27 -06:00
John Kessenich
deec1933e9 Web: Turn off includes, independent preprocessing path, fine tune all.
Saved about 21K, size down to 380K of MSVC x86 code.
Fixed one bug that needs to be looked at on the master branch:
The test for needing a Vulkan binding has a bug in it, "!layoutAttachment"
which does not mean "no layoutAttachment", because that is non-zero.
This is why some test and test results changed.
2019-08-20 23:21:56 -06:00
John Kessenich
b9197c812e Web: Make switched methods all be non-virtual, more web-dependent code,
added a few more HLSL flag tests.  This was mostly focused on the SPV generator.
Saves about 17K.
2019-08-20 23:21:56 -06:00
John Kessenich
fb4f2333da Web: Use isEsProfile() instead of run-time testing; remove more atomics
Saves 2.5K, and design is better.
2019-08-20 23:21:56 -06:00
John Kessenich
155d351f86 Web: Remove unused stage functionality, SPIR-V logger, and hex_utils
Saves another 20K.
2019-08-20 23:21:56 -06:00
John Kessenich
7015bd658e Web: Remove/rationalize a set of *_EXTENSIONS, using GLSLANG_WEB.
Focus was on the front end (not SPIR-V), minus the grammar.
Reduces #ifdef count by around 320 and makes the web build 270K smaller,
which is about 90% the  target size.

The grammar and scanner will be another step, as will the SPIR-V backend.
This makes heavy use of methods #ifdef'd to return false as a global way
of turning off code, relying on C++ DCE to do the rest.
2019-08-20 23:21:55 -06:00
John Kessenich
e66dace97e Web: First pass of tabling the built-in function declarations.
Doing this much saved about 11.5K, including adding all the infrastructure.
2019-08-20 23:21:55 -06:00
John Kessenich
23d27751e8 Web: Selectively remove a few key features, using #ifndef GLSLANG_WEB
Save about 100K.

N.B.: This is done by eliminating a function call, at a high level,
not by #ifdef'ing a bunch of code.

Also, removed no longer needed *_EXTENSION #ifdef in the code not
needed by GLSLANG_WEB.
2019-08-20 23:21:55 -06:00
John Kessenich
bfc21ff1a9 Web: Change a bunch of HLSL methods from dynamic to compile-time known.
This saves about 7K.
By changing just a few methods to be compile-time known, a bunch of
scattered code becomes DCE.
2019-08-20 23:21:55 -06:00
John Kessenich
d4ed5158d1 Web: Remove a few additional HLSL constructs with ENABLE_HLSL.
Saves about 3K.
2019-08-20 23:21:55 -06:00
John Kessenich
13761069b5 Web: Add sanity check test suite for smaller-footprint builds.
For the smallest builds, google tests will not be present, in
addition to a large number of tests not being capable of running.
2019-08-20 23:21:55 -06:00
John Kessenich
7fc8683491
Merge pull request #1813 from jeffbolznv/compositeconstruct
Handle SPIR-V type mismatch when constructing a composite
2019-07-28 23:20:26 -06:00
John Kessenich
642b6ad99f
Merge pull request #1844 from alelenv/ast_print_fix
Fix bug in printing trailing comma when dumping AST for a structure.
2019-07-28 21:33:30 -06:00
Ashwin Lele
c1e61d6cff Fix bugs in missing Builtin decoration for some NV builtins for tessellation
control shaders.
Fix bug in member remapping.
2019-07-22 12:36:38 -07:00
Ashwin Lele
a76d1c211b Fix bug in printing trailing comma when dumping AST for a structure. 2019-07-17 14:40:58 -07:00
John Kessenich
e383c5f55d
Merge pull request #1837 from KhronosGroup/fix-NV_compute_shader_derivatives
ESSL: Fix #1823: Conditions for when derivatives are in compute shader.
2019-07-15 19:49:46 -06:00
Sahil Parmar
f2dcc87c6a Allow unsized view array dimension for non-block perviewNV attributes 2019-07-15 16:14:00 -07:00
John Kessenich
50dc8c350b
Merge pull request #1824 from KhronosGroup/fix-spec-expr-array-check
SPV: Fix #1783: Don't do bounds checking for spec-const-expression size
2019-07-15 10:55:30 -06:00
John Kessenich
33081e01d3 ESSL: Fix #1823: Conditions for when derivatives are in compute shader. 2019-07-15 01:20:18 -06:00