Commit Graph

3414 Commits

Author SHA1 Message Date
Jeff Bolz
c5b669e04c Add GL_EXT_shader_subgroup_extended_types support 2019-09-17 23:44:27 -05:00
John Kessenich
8b8adf79c1
Merge pull request #1894 from ShchchowAMD/master
Add flags for local size values ( compute shader )
2019-09-16 06:35:12 -06: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
fe0b2bd694
Merge pull request #1897 from dj2/unused
Comment out unused params; Fix type warning.
2019-09-12 08:40:57 -06:00
John Kessenich
fdd13ca10f
Merge pull request #1895 from amdrexu/bugfix
Fix incorrect function prototypes of 64-bit findLSB/findMSB
2019-09-11 12:08:08 -06:00
Dan Sinclair
23e9f5ca74 Comment out params instead of removing 2019-09-11 08:59:47 -04:00
Dan Sinclair
24a5d23d5a Remove unused params 2019-09-10 15:39:22 -04:00
Rex Xu
3b1b9e2957 Fix incorrect function prototypes of 64-bit findLSB/findMSB
According to the 32-bit counterparts, their forms should be
genI64Type findLSB(genI64Type value)
genI64Type findLSB(genU64Type value)
genI64Type findMSB(genI64Type value)
genI64Type findMSB(genU64Type value)
2019-09-09 22:53:02 +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
34953810a6
Merge pull request #1892 from greg-lunarg/kg106
Update spirv-tools and spriv-headers known good.
2019-09-04 20:49:12 -06:00
Greg Fischer
d6df1fb13f Update spirv-tools and spriv-headers known good. 2019-09-04 14:15:57 -06:00
John Kessenich
56f61cccef
Merge pull request #1889 from Roy-AMD/code-refine
Code refine
2019-09-03 03:02:13 -06:00
Roy
2ad4492ee4 code refine
Reduce the number of cycles.
2019-09-02 17:07:39 +08:00
Roy.li
e8e138b9e0
Merge pull request #6 from Roy-AMD/sync
Sync code
2019-09-02 11:58:14 +08:00
Roy.li
f7f2694b19
Merge pull request #5 from KhronosGroup/master
Sync code from KhronosGroup/glslang master
2019-09-02 11:56:45 +08: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
7de044c062 Non-functional: Make whitespace/braces consistent for a recent commit. 2019-08-30 09:51:06 -06:00
John Kessenich
796df2d74e
Merge pull request #1885 from zoddicus/fixUnInitializedVariableWarnings
Initialize variable to avoid uninitialized variable warnings in Clang
2019-08-28 22:44:15 -06:00
Ryan Harrison
8b91ecbac9 Change to initializing the variable 2019-08-28 13:15:15 -04:00
Ryan Harrison
6d35ae89c0 Return nullptr after assert to avoid uninitialized variables
In the current version of the code on non-debug builds these cases
will fallthrough, since assert is a no-op, and eventually make a call
passing in |op| which hasn't been initialized. clang is currently
throwing a warning about this behaviour when integrating downstream.

This patch changes the behaviour, so that in any branch that has an
assert now has a return nullptr, to indicate failure after it and
avoid the uninitialized variable usage.
2019-08-28 11:36:27 -04: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
John Kessenich
efd47a8fae Documentation: Provide more detail in setting up the environment. 2019-08-28 02:25:26 -06:00
John Kessenich
f27bd2aa2e
Merge pull request #1883 from Kangz/fix_gn
BUILD.gn: Add missing HLSL files.
2019-08-27 07:37:09 -06:00
Corentin Wallez
5442b4fffc BUILD.gn: Add missing HLSL files. 2019-08-27 15:24:31 +02:00
John Kessenich
9f5a43a570
Merge pull request #1881 from baldurk/buffer-array-bind-reflection-fix
Dereference any array type before expanding root-level SSBO members
2019-08-26 21:36:09 -06:00
John Kessenich
32d18c552b
Merge pull request #1882 from Kangz/fix-chrome
GN build (for Chromium): enable HLSL in dependents.
2019-08-26 07:47:30 -06:00
Corentin Wallez
9757da4f8e GN build (for Chromium): enable HLSL in dependents.
The previous fix for this only enabled HLSL internally in glslang which
means that dependent using HLSL, for example shaderc, failed
compilation.
2019-08-26 14:13:54 +02: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
John Kessenich
d6a5cc6580
Merge pull request #1878 from dneto0/chrome-fix
GN build (for Chromium): enable HLSL
2019-08-26 02:03:44 -06:00
David Neto
96bec343d0 GN build (for Chromium): enable HLSL 2019-08-23 14:35:35 -04:00
Jeff Bolz
387657e4cf GL_NV_integer_cooperative_matrix support 2019-08-22 20:37:59 -05:00
John Kessenich
a3bc04b278 Bump revision. 2019-08-22 11:20:40 -06:00
John Kessenich
c190d5bc27
Merge pull request #1874 from KhronosGroup/inherit-memory-qualifiers
GLSL: Inherit memory qualifiers, both declaratively and in execution.
2019-08-22 11:20:17 -06: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
28f314d436
Merge pull request #1875 from jonahryandavis/extra-tokens
Fix conformance with -Wextra-tokens
2019-08-22 08:52:15 -06:00
Jonah Ryan-Davis
c27def379c Fix conformance with -Wextra-tokens 2019-08-22 10:36:12 -04:00
John Kessenich
c817600491 Bump version. 2019-08-21 11:12:43 -06:00
John Kessenich
ea69a29829
Merge pull request #1855 from KhronosGroup/web
Web:  Create a very small-footprint glslang for web use.
2019-08-21 11:07:01 -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
d8834df992 Web: Optional error management and error tightening.
Saves about 6.5K
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
39697cdb9d Web: Remove unnecessary GLSL numeric types, and some collateral.
This saves another 40K of x86 binary, which is about 13% of the target size.
2019-08-20 23:21:56 -06:00
John Kessenich
3e4b6ff76a Web: Tighten up sampling code and interfaces.
Saves about 9K.
2019-08-20 23:21:56 -06:00
John Kessenich
eaf4496312 Web: Complete the removal of vendor-specific #ifdef's, including CMake. 2019-08-20 23:21:56 -06:00
John Kessenich
441b2ac4d1 Web: Prune grammar and lexor down to needed subset.
About 60K smaller (20% the target size is these units of 300K).
Over 300 fewer #ifdef.

This adds a new glslang.m4 file that needs to be processed by m4 to get
the glslang.y file needed by bison.  See comment in glslang.m4 for more
detail.

This updates the updateGrammar script to do the .m4 -> .y processing,
to conditionally exclude grammar not needed for the web build.
2019-08-20 23:21:55 -06:00
John Kessenich
a28f7a75d1 Web: Generalize _EXTENSIONS* in SPIR-V back-end.
About 50 fewer #ifdefs.
About 14K smaller.
Note, the base size is ill-defined due to optimizer settings (size vs. performance),
compression, and target architecture.  Some recent %'s are accidentally reported as
3X the real savings.  Early %'s were accurate.  What matters though is that each
step got worthwhile gains, and what the final size ends up being.
2019-08-20 23:21:55 -06:00