2338 Commits

Author SHA1 Message Date
John Kessenich
092b7d2e20 Build: Fix a couple build issues. 2017-09-30 14:54:18 -06:00
John Kessenich
77ea30bdc9 HLSL: Additional attribute support: [[]], namespace, parameters:
- support C++11 style brackets [[...]]
- support namespaces [[vk::...]]
- support these on parameter declarations in functions
- support location, binding/set, input attachments
2017-09-30 14:34:50 -06:00
John Kessenich
3693e631f5 Fix #1060: Could crash if using --source-entry-point with -e; fixed. 2017-09-29 17:51:52 -06:00
John Kessenich
5a57ca680f Merge pull request #1078 from greg-lunarg/addopt14
Remove opaque workarounds
2017-09-29 20:57:30 +03:00
GregF
354a54c67d Legalization: Fix tests after workarounds removed 2017-09-29 10:08:20 -06:00
John Kessenich
d41993d9d2 SPV: rationalize parameter handling for "original" and "writable" parameters. 2017-09-29 09:58:11 -06:00
John Kessenich
bed4e4f7e4 HLSL: Pass opaques by local copy, instead of by interface original.
Also, remove assumption that if something is opaque that it
must be in the UniformConstant storage class.

This allows function declarations to know all parameters will
be in the Function storage class.
2017-09-29 09:57:00 -06:00
John Kessenich
15fa7ef5f5 HLSL: Remove workarounds for assigning to opaques.
This assumes it will be combined with optimizing transforms
that eliminate assignments to opaques.
2017-09-29 09:53:24 -06:00
John Kessenich
dabd1bf2f0 Merge pull request #1076 from LoopDawg/shadow-tx-types
HLSL: force textures to shadow modes from combined samplers
2017-09-29 05:07:50 +03:00
LoopDawg
195f584e09 HLSL: force textures to shadow modes from combined samplers
Texture shadow mode must match the state of the sampler they are
combined with.  This change does that, both for the AST and the
symbol table.  Note that the texture cannot easily be *created*
the right way, because this may not be known at that time.  Instead,
the texture is subsequently patched.

This cannot work if a single texture is used with both a shadow and
non-shadow sampler, so that case is detected and generates an error.
This is permitted by the HLSL language, however.  See #1073 discussion.

Fixed one test source that was using a texture with both shadow and
non-shadow samplers.
2017-09-28 14:17:25 -06:00
John Kessenich
fc7aeaee55 Merge pull request #1077 from greg-lunarg/addopt12
Legalization: Fix warnings and disable tests when spirv-tools not present
2017-09-28 22:38:29 +03:00
GregF
52fe3d598c Legalization: Fix warnings and disable tests when spirv-tools not present 2017-09-28 10:13:23 -06:00
John Kessenich
3ddcd3f12f Merge pull request #1070 from greg-lunarg/addopt8
Enable HLSL legalization
2017-09-28 05:56:56 +03:00
GregF
e2b3616370 Advance spirv-opt known-good to hopefully fix travis multithread failure 2017-09-27 15:46:59 -06:00
GregF
b56366ab75 Legalization: Skip spirv-tools tests 2017-09-27 15:23:15 -06:00
GregF
741d1f20ed Pick up latest spirv-tools in attempt to fix travis failures 2017-09-27 15:22:19 -06:00
GregF
87fd74291a Try Python interpreter on update_glslang_sources.py in appveyor 2017-09-27 15:20:56 -06:00
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