Commit Graph

2321 Commits

Author SHA1 Message Date
GregF
f451756d82 Fix travis and appveyor calls to update_glslang_sources.py 2017-09-27 15:19:28 -06:00
GregF
cd1f169c6a Enable HLSL legalization
Also added known-good mechanism to fetch latest validated spirv-tools.
Also added -Od and -Os to disable optimizer and optimize for size.

Fetching spirv-tools is optional for both glsl and hlsl. Legalization
of hlsl is done by default if spirv-opt is present at cmake time.
Optimization for glsl is currently done through the option -Os.

Legalization testing is currently only done on four existing shaders.
A separate baseLegalResults directory holds those results. All previous
testing is done with the optimizer disabled.
2017-09-27 15:06:05 -06:00
John Kessenich
44dd6a00c3 Merge pull request #1072 from amdrexu/feature
Implement extension GL_NV_shader_atomic_int64
2017-09-27 18:11:06 +03:00
Rex Xu
e8fe8b0de9 Implement extension GL_NV_shader_atomic_int64 2017-09-27 12:06:27 +08:00
John Kessenich
f21c173a05 Merge pull request #1071 from antiagainst/ninja-make
Travis: use make instead of ninja
2017-09-26 00:08:30 -06:00
Lei Zhang
afa128a8df Travis: use make instead of ninja and limit concurrent jobs 2017-09-25 14:04:51 -04:00
John Kessenich
9cf5dfbdc7 Merge pull request #1063 from LoopDawg/remapper-error-cleanup
Remapper: make remapper robust against non-exiting error handlers
2017-09-23 06:32:02 -06:00
John Kessenich
ea5204d192 Build: Merge pull request #1068 from greg-lunarg/addopt4
CMake file changes for SPIR-V legalization for HLSL
2017-09-22 13:51:02 -06:00
GregF
fd34f0e602 CMake changes for HLSL legalization
Cmake now looks for External/spirv-tools. If found, it links in
SPIRV-Tools-opt and SPVRemapper, and adds -DENABLE_OPT to build.
2017-09-21 17:01:47 -06:00
LoopDawg
8004d36528 Remapper: make remapper robust against non-exiting error handlers
Remapper errors are generally fatal: there has been some unexpected situation while
parsing the SPV binary, and there is no reasonable way to carry on.  The
errorHandler() function is called in this case, which by default exits, but
it is possible to submit a handler which does not.  In that case the remapper would
carry on in a bad state.

This change ensures a graceful termination of the remap() function.

While a try {} catch {} construct would be the ideal and safe way to do this,
that's off limits for certain environments, so this tries to do the same thing
with explicit code, to catch all the bailout paths.
2017-09-20 15:19:43 -06:00
John Kessenich
5f77d864f3 HLSL: Fix #1064: Don't include empty structures on OpEntryPoint 2017-09-19 11:23:58 -06:00
John Kessenich
31365afaf4 Merge pull request #1044 from dsrbecky/image_external_essl3
Add support for GL_OES_EGL_image_external_essl3
2017-09-15 21:10:08 -06:00
xavier
ae8af5d33e HLSL: fix array[1] of vec4 constant declaration. 2017-09-15 15:28:38 -06:00
John Kessenich
c64a9dd6a9 Test: Make another test legal HLSL, and rationalize GLSL vs HLSL addConstructor(). 2017-09-15 13:15:23 -06:00
John Kessenich
bdbbc68e29 HLSL: Add bounds checking, shared with GLSL. Partially address #1032. 2017-09-14 20:04:20 -06:00
John Kessenich
346dd7c747 Merge pull request #1051 from LoopDawg/bug-1049
HLSL: allow split type in InputPatch template type, & HS return types.
2017-09-14 18:18:19 -06:00
LoopDawg
4a145dbf45 HLSL: handle split InputPatch templat type in patch constant functions
InputPatch parameters to patch constant functions were not using the
internal (temporary) variable type.  That could cause validation errors
if the input patch had a mixture of builtins and user qualified members.

This uses the entry point's internal form.

There is currently a limitation: if an InputPatch is used in a PCF,
it must also have appeared in the main entry point's parameter list.
That is not a limitation of HLSL.  Currently that situation is detected
and an "implemented" error results.  The limitation can be addressed,
but isn't yet in the current form of the PR.
2017-09-14 16:50:37 -06:00
LoopDawg
a5d8616478 HLSL: allow mixed user & builtin members in hull shader output structure
Hull shaders have an implicitly arrayed output.  This is handled by creating an arrayed form of the
provided output type, and writing to the element of it indexed by InvocationID.

The implicit indirection into that array was causing some troubles when copying to a split
structure.  handleAssign was able to handle simple symbol lvalues, but not an lvalue composed
of an indirection into an array.
2017-09-14 16:50:37 -06:00
John Kessenich
ba6a3c290e GLSL: Make gl_Layer and gl_ViewportIndex always be outside blocks.
There was some ambiguity/contradiction in this behavior, and
Khronos decided glslang should always have these outside blocks,
rather than have stage/vendor/target variations.
2017-09-13 13:22:50 -06:00
John Kessenich
aab3bcffea Merge pull request #1056 from KhronosGroup/glsl-entrypoint-rename
GLSL: Promote HLSL entry-point renaming code to be used by GLSL as well.
2017-09-12 10:53:05 -06:00
John Kessenich
9855bdad00 GLSL: Promote HLSL entry-point renaming code to be used by GLSL as well.
Fixes #1045.
2017-09-12 09:40:54 -06:00
John Kessenich
4f4683d251 Merge pull request #1050 from amdrexu/feature
Implement the extension GL_AMD_shader_fragment_mask
2017-09-12 09:09:37 -06:00
John Kessenich
30ac052574 Merge pull request #1055 from KhronosGroup/strdup
Build: Fix strdup -> _strdup warnings.
2017-09-11 22:04:59 -06:00
John Kessenich
d9bd97d054 Build: Fix strdup -> _strdup warnings. 2017-09-11 21:56:09 -06:00
John Kessenich
b3ca4045c5 Build: Fix build warnings. 2017-09-11 20:39:54 -06:00
John Kessenich
5002c26b5e Fix #1043: set all scan string-locations to have bias, not just the first one. 2017-09-11 20:35:49 -06:00
John Kessenich
a25530cc18 Non-functional: Make usage for entry points more consistent. 2017-09-11 20:13:49 -06:00
John Kessenich
e22c11fd0a Merge pull request #1053 from mchock-nv/mchock-nv-fix-lambda
Delete unused 'this' capture
2017-09-11 19:33:11 -06:00
John Kessenich
ea1ea974eb Address #1052: Have language-level exits of case statements. 2017-09-11 19:25:17 -06:00
mchock-nv
933c10cd4b Delete unused 'this' capture
Remove an unused 'this' entry from a lambda capture list.

This cleans up a unused-lambda-capture warning.
2017-09-11 15:20:52 -07:00
amhagan
05506bb874 Implement the extension GL_AMD_shader_fragment_mask 2017-09-09 22:05:24 +08:00
John Kessenich
d004e5ca4c Merge pull request #1047 from svenstaro/add-stdin-option
Add stdin option (fixes #598)
2017-09-07 20:02:37 -07:00
Sven-Hendrik Haase
0dd1285cb6 Add --stdin 2017-09-07 20:35:40 +02:00
John Kessenich
8688e3fb77 Merge pull request #1048 from LoopDawg/opaque-type-fix
Fix lvalue test in SPIR-V generation
2017-09-06 21:50:20 -07:00
LoopDawg
76117921b9 Fix lvalue check in SPIR-V generation
There were several locations in TGlslangToSpvTraverser::handleUserFunctionCall testing for
whether a fn argument should be in the lvalue or rvalue array.  They must get the same
result for indexing sanity, but had slightly different logic.

They're now forced into the same test.
2017-09-06 15:04:52 -06:00
David Srbecký
2c5b3d64af Add support for GL_OES_EGL_image_external_essl3 2017-09-05 14:56:26 +01:00
John Kessenich
3a21c88050 Merge pull request #1042 from LoopDawg/warning-fix-2
WIP: Linux build warning fix
2017-08-31 23:46:56 -06:00
John Kessenich
43f682f652 Merge pull request #1039 from amdrexu/bugfix
Fix issues of GL_ARB_viewport_layer_array
2017-08-31 23:36:09 -06:00
LoopDawg
2baa774259 Linux build warning fix
* Remove complaint about unused function parameter in resolveUniformLocation()
* Remove complaint about defined but not used variable in spvIR.h
2017-08-31 18:09:58 -06:00
Rex Xu
2a305f6531 Fix issues of GL_ARB_viewport_layer_array 2017-09-01 06:54:19 +08:00
John Kessenich
75e057f980 Merge pull request #1037 from LoopDawg/clip-cull-geom
HLSL: add geometry stage support for clip/cull distance
2017-08-31 12:36:06 -06:00
LoopDawg
5e5b12e931 HLSL: add geometry stage support for clip/cull distance
Changes:

(1) Allow clip/cull builtins as both input and output in the same shader stage.  Previously,
not enough data was tracked to handle this.

(2) Handle the extra array dimension in GS inputs.  The synthesized external variable can
now be created with the extra array dimension if needed, and the form conversion code is
able to handle it as well.

For example, both of these GS inputs would result in the same synthesized external type:

    triangle in float4 clip[3] : SV_ClipDistance

    triangle in float2 clip[3][2] : SV_ClipDistance

In the second case, the inner array dimension packs with the 2-vector of floats into an array[4],
which there is an array[3] of due to the triangle geometry.
2017-08-31 10:37:46 -06:00
John Kessenich
a459fc8142 Merge pull request #1031 from xxxbxxx/for-upstream-2
HLSL: fix preprocessor concatenation behaviour.
2017-08-29 12:41:55 -06:00
John Kessenich
4e2f05da41 Build: Fix #1036: size_t warning. 2017-08-29 12:36:09 -06:00
xavier
eb71cdd5bb HLSL: fix preprocessor concatenation behaviour.
Fix #772.
2017-08-29 00:35:01 +02:00
John Kessenich
ea0c1643ab Merge pull request #1035 from LoopDawg/clip-cull-type-fix
HLSL: (minor) fix type on clip/cull index result
2017-08-28 16:07:55 -06:00
LoopDawg
d6f4d9b48c HLSL: fix type on clip/cull index result
While adding geometry stage support for clip/cull, it transpired that the
existing clip/cull support was not setting the type of the result of indexing
into the clup/cull variable.  That's a defect independent of the geometry
support, so to simplify the geometry PR, this is addressed separately.

It doesn't appear to change the generated SPIR-V, but that's probably down to
something else tolerating a bad input.
2017-08-28 14:05:41 -06:00
John Kessenich
82e95a3aa5 SPV: Add auto location mapping of non-opaque non-block uniform variables.
Fix #1019.
2017-08-26 15:47:25 -06:00
John Kessenich
8268a35504 Build: Attempt better support for VS 2012.
Fix #1020. Fix #1021. Fix #1022.
2017-08-25 21:35:37 -06:00
John Kessenich
74c5f711b4 Merge pull request #1014 from KhronosGroup/SPV_EXT_shader_viewport_index_layer
SPV: 1st pass implementation of SPV_EXT_shader_viewport_index_layer.
2017-08-25 13:33:16 -06:00