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
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
John Kessenich
b6d3ee5aca
Web: Turn off bracket-style attributes, reflection, and IO mapping.
2019-08-20 23:21:55 -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
Ryan Harrison
1f6fedd3b5
Add in header for uint32_t definition
...
This is needed for stricter/newer MSVC builds of downstream users.
2019-08-01 15:07:18 -04:00
Canon lee
03a93ae153
Fix Clang compiler warning.
2019-07-28 20:53:08 +08:00
Canon lee
c24033afc3
Fix location distribution not in order
2019-07-28 20:13:23 +08:00
Canon lee
1247baa678
Merge branch 'sync' into automapping-opengl-location
...
Sync code from KhronosGroup/glslang.
2019-07-26 00:47:16 +08:00
Roy
8a5824f5bf
Fix memory init issue, to make sure the class members are init in order.
2019-07-25 10:52:10 +08: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
John Kessenich
9f2236e58e
Build: shut up warning to add unnecessary parens.
2019-07-17 19:15:47 -06: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
John Kessenich
1a6e8534ce
GLSL: Fix #1833 : Don't constant fold integer mix to a float.
2019-07-13 12:23:11 -06:00
John Kessenich
71892a5eda
Merge pull request #1833 from AaronHaganAMD/master
...
Add support for SPV_KHR_shader_clock
2019-07-11 13:16:09 -06:00
amhagan
91fb0091a2
Add support for SPV_KHR_shader_clock
2019-07-10 21:34:12 -04:00
Jeff Bolz
c1ad396258
Avoid generating 8/16-bit constants when 8/16-bit arithmetic extensions aren't enabled
2019-07-10 15:04:29 -05:00
John Kessenich
8aa9a7bb8f
Merge pull request #1825 from amdrexu/bugfix
...
Change implementation of gl_SIMDGroupSizeAMD
2019-07-09 00:14:27 -06:00
Rex Xu
e085d83427
Change implementation of gl_SIMDGroupSizeAMD
2019-07-06 23:40:10 +08:00
John Kessenich
96524f9168
SPV: Fix #1783 : Don't do bounds checking for spec-const-expression size
...
It's okay for symbolic spec-consts, but without constant folding,
not okay when the array size is an expression.
2019-07-03 09:37:25 -06:00
John Kessenich
e5c394bcba
Standalone: Fix #1814 : Check that linkage was specified for reflection.
2019-07-02 09:47:42 -06:00
John Kessenich
974a586688
Merge pull request #1817 from jeffbolznv/demote
...
Implement GL_EXT_demote_to_helper_invocation
2019-07-02 02:20:18 -06:00
John Kessenich
73f0108138
Build: Tweak PR #1808 to avoid an implicit conversion warning.
2019-07-02 01:51:50 -06:00
Jeff Bolz
ba6170b534
Implement GL_EXT_demote_to_helper_invocation
2019-07-01 09:36:15 -05:00
Shahbaz Youssefi
6cca0e983e
Remove extraneous semicolons
...
They cause a warning (-Wextra-semi) that can lead to a compile error
(-Werror).
2019-06-25 13:20:16 -04:00
Jeff Bolz
4b5c498923
Add a bunch of missing cases to promoteConstantUnion. Use macros to expand all the cases more simply.
2019-06-22 22:28:25 -05:00
John Kessenich
605afc7b1b
SPV: Add a switch for favoring non-NaN operands in min, max, and clamp.
2019-06-17 23:33:09 -06:00
Samuel Iglesias Gonsálvez
2cfde2bdbe
Delete duplicated gl_SubGroupSizeARB builtin treatment
...
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2019-06-17 16:05:52 +02:00
John Kessenich
def9662348
Merge pull request #1796 from Igalia/siglesias/fix-gl_SubGroupSizeARB-tese-geom
...
Add missing GL_ARB_shader_ballot builtins to Geometry and Tessellatio…
2019-06-16 23:02:02 -06:00
Samuel Iglesias Gonsálvez
dbe6b06dde
Add missing GL_ARB_shader_ballot builtins to Geometry and Tessellation shaders
...
When processing Geometry and Tessellation Control/Evaluation shaders,
the builtins defined by GL_ARB_shader_ballot were not processed by
glslang. This specially a problem for gl_SubGroupSizeARB because, it is
treated as shader input instead of uniform on Vulkan.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2019-06-15 12:55:50 +02:00
Jeff Bolz
38a52fca93
Add gl_SemanticsVolatile to GL_KHR_memory_scope_semantics, and make volatile-qualified atomics generate MemorySemanticsVolatile when using the Vulkan memory model
2019-06-14 09:57:01 -05:00
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
Canon lee
fc017379e3
code format refine
2019-06-07 00:16:31 +08:00
Roy
a137d2ba86
Add interface symbol and uniform symbol location auto mapping for OpenGL shader.
2019-06-06 17:54:04 +08:00
Dan Sinclair
3555043c04
Remove unused parameter
2019-06-05 11:48:20 -04:00
Jeff Bolz
71e5b1323d
Add missing NV_EXTENSIONS ifdef
2019-06-04 09:47:41 -05:00
Jeff Bolz
c6f0ce8dbc
Support GL_ARB_fragment_shader_interlock
2019-06-03 11:55:25 -05:00