Commit Graph

576 Commits

Author SHA1 Message Date
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
4b4b41a634 HLSL: Fix #1815: Don't constant fold spec-constant array indexing. 2019-07-03 01:28:51 -06:00
Matthew Albrecht
cda52d5333 Fixed .dll install on MSVC. 2019-05-23 19:06:44 -05:00
John Kessenich
5cb2fa2ad2 Fix #1759: Check for specialization constants when literals required. 2019-05-03 08:40:35 -06: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
John Kessenich
567396b6b4 Whitespace: Fix some tabs->spaces, mostly to retriggered failed bots. 2019-02-11 03:43:12 -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
544c039d26 HLSL: Fix #1679: Add HLSL earlydepthstencil -> SPV EarlyFragmentTests. 2019-01-28 22:19:43 -07:00
John Kessenich
d9cee59afa
Merge pull request #1626 from KhronosGroup/extension-support
Infrastructure: Generalize and broaden per-variable extension checking.
2019-01-23 12:05:22 -08:00
Hodgman
0bb89f5809 HLSL: Protect against some crashes 2019-01-21 18:21:11 -08:00
John Kessenich
493dee0ade
Merge pull request #1656 from amdrexu/bugfix
Fix xfb_stride incorrectness(#1654)
2019-01-17 21:53:34 -07:00
John Kessenich
d9739794e9
Merge pull request #1662 from dneto0/fix-leak2
HLSL: Avoid leaking a shadow sampler struct
2019-01-17 06:29:41 +07:00
David Neto
edadbed6fb HLSL: Avoid leaking a shadow sampler struct 2019-01-16 17:04:58 -05:00
David Neto
806e0573da Avoid leaking name for counter buffer 2019-01-16 10:44:31 -05:00
John Kessenich
b2395e9ddf HLSL: Fix #1655; use "" for nullptr file names. Needs test cases. 2019-01-16 16:07:51 +07: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
John Kessenich
28be4543cd Infrastructure: Generalize and broaden per-variable extension checking. 2019-01-09 22:21:22 +07:00
John Kessenich
b23d232ec5 Licensing. Fixes #958. Add licenes file and update copyrights. 2018-12-14 10:47:35 -07:00
Rémi Verschelde
ebfd91a719 Remove Unix executable permission from text files 2018-12-10 10:49:16 +01:00
John Kessenich
bd1c1831d5 Manually merge ClemensRognerSD-dx9-sampler and resolve conflicts. 2018-12-07 18:38:26 -07:00
greg-lunarg
5d43c4aac7 SPV: Fix #1575, fix #1593: Support HLSL #line
SPIR-V OpLines now contain filenames from HLSL-style #lines.
2018-12-07 17:36:33 -07:00
John Kessenich
e3b76ed608 Merge branch 'scalar_block_layout' of https://github.com/jeffbolznv/glslang into jeffbolznv-scalar_block_layout 2018-11-16 09:57:33 -07:00
Jeff Bolz
7da39ed968 Implement GL_EXT_scalar_block_layout 2018-11-14 09:30:53 -06:00
t.jung
31cd98c7b2 HLSL: implemented c register handling
Adjusted a test not to use c register for
a structured buffer, they are supposed to
use t registers

Added comments with hints for what are the
register types are used for.
2018-11-14 13:12:12 +01:00
John Kessenich
918caa7ee4
Merge pull request #1547 from Igalia/apinheiro/xfb-struct-assignment
Apinheiro/xfb struct assignment
2018-11-09 12:27:39 -07:00
Jeff Bolz
02ed310ac3 Rename PCH macro to glslang_pch (to avoid name collision) and update to latest spirv-tools 2018-11-07 09:35:31 -06:00
Jeff Bolz
22d0b7cbad Use precompiled headers for some glslang projects 2018-10-31 15:38:08 -05:00
Alejandro Piñeiro
af8c1bdb16 ParseHelper: assign xfb_offset for struct members too
If the out variable is a struct type, with a xfb_offset explicitly
assigned, the members need to get their xfb_offset assigned. This is
specially relevant, as we cannot use layout qualifiers on struct
members.
2018-10-31 10:34:44 +01:00
John Kessenich
086febc448 PP: Fix #155: Don't give error on HLSL PP-only parsing. 2018-10-25 12:43:02 -06:00
otakuto
d03da06ac1 Remove execute permissions 2018-08-07 03:16:20 +09:00
John Kessenich
62faea79d7
Merge pull request #1451 from KhronosGroup/shadow-forces-depth
GLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.
2018-07-23 16:41:00 -07:00
John Kessenich
11da9eed5d HLSL: Fix #1445: distance() works on scalars. 2018-07-23 16:55:01 -06:00
John Kessenich
7d4c9a07b5 GLSL: Construct shadow texture from non-shadow sampler.
Tracks https://github.com/KhronosGroup/GLSL/pull/22.
2018-07-23 15:59:09 -06:00
John Kessenich
0ea33a2628 Non-functional: Retrigger bots; the previous failure looks suspicious. 2018-07-11 02:24:36 -06:00
John Kessenich
cf6bd066b9 HLSL: Fix #1432: Globally initialize local static variables. 2018-07-11 01:09:14 -06:00
John Kessenich
dccfeedfc3 HLSL: Fix #1423: implement CalculateLevelOfDetailUnclamped().
(If there is a bias issue, we need to discover what it is.)
2018-07-02 18:53:19 -06:00
LoopDawg
c59916710e HLSL: allow self-type cast (as no-op passthrough)
Previously, casting an object of a struct type to an identical type
would produce an error.  This PR allows this case.

As a side-effect of the change, several self-type casts in existing
tests go away.  For example:

    0:10          Construct float ( temp float)
    0:10            'f' ( in float)

becomes this (without the unneeded constructor op):

    0:10          'f' ( in float)

For vector or array types this can result in somewhat less overall code.

Fixes: #1218
2018-05-17 13:03:12 -06:00
LoopDawg
4e6d3eaf5d HLSL: require coverage mask to be arrayed output.
SPIR-V requires the coverage mask to be an array of integers, but HLSL
allows scalar integers.  This adds the requisite type conversion and
wrapped entry point handling.

Fixes: #1202
2018-05-16 13:58:10 -06:00
John Kessenich
cfb05ec702
Merge pull request #1379 from LoopDawg/groupid-fix
HLSL: various SPIR-V compute shader IDs must be 3-vectors of integers
2018-05-16 10:36:16 -06:00
LoopDawg
91a8178efb HLSL: various SPIR-V compute shader IDs must be a 3-vector of integers.
This PR forces the external definition of SV_GroupID variables to 3-vectors.
The conversion process between the shader-declared type and the external type
happens in wrapped main IO variable conversion.

The same applies to SV_DispatchThreadID and SV_GroupThreadID.

Fixes: #1371
2018-05-16 06:48:02 -06:00
LoopDawg
1326b8c754 HLSL: Allow stream output Append() method after entry point.
Append() method is special: unlike most outputs, it does not copy
some temporary data to a symbol in the entry point epilogue, but
rather uses an emit builtin after each write to the output stream.

This had been handled by remembering the special output symbol for
the stream as it was declared in the shader entry point before
symbol sanitization.  However the prior code was too simple and
only handled cases where the Append() method happened after the
entry point, so that the output symbol had been seen.

This PR adds a patching step so that the Append()s may appear in
any order WRT the entry point.  They are patched in an epilogue,
whereupon it is guaranteed in a well formed shader that we have
seen the appropriate declaration.

Fixes #1217.
2018-05-15 15:13:09 -06:00
Matthew Albrecht
1199cf92f7 Fixed install for SPIRV, glslang, and hlsl when building shared libs 2018-04-26 14:07:46 -05:00
John Kessenich
c034c5a8a2 HLSL/SPV: Declare DepthReplacing for shaders declaring SV_Depth* outputs. 2018-04-13 18:36:58 -06:00
danginsburg
95c87b657c Fix issue #1350 - set the node type to match the atomic TIntermAggregate node type so that AtomicSMin/Max is not generated with a result type of void. 2018-04-12 16:46:04 -04:00
John Kessenich
b9e9e57f12
Merge pull request #1326 from mattparks/patch1
Allowed for LIB_TYPE to be set to switch between static and shared libs for glslang, SPIRV, and HLSL
2018-04-11 18:14:46 -06:00
John Kessenich
461ea09943 Non-functional: Fix tabs. 2018-04-11 00:03:47 -06:00
John Kessenich
6ae18707f9 HLSL: Fix #1332: consistently use uint for counter buf typing. 2018-04-10 11:59:33 -06:00
John Kessenich
5611c6d27b GLSL/SPV: Implement SPV_EXT_descriptor_indexing and GL_EXT_nonuniform_qualifier 2018-04-05 11:25:02 -06:00
Matthew Albrecht
6c5f649ae8 Allowed for LIB_TYPE to be set to switch between static and shared libs for glslang, SPIRV, and HLSL 2018-03-30 09:32:03 -05:00
GregF
fb03a55e0f Only print legalization warning if optimizer disabled 2018-03-29 13:17:54 -06:00