platform/upstream/glslang.git
7 years agoTests: Non-determinancy: Add back in the IntMin tests.
John Kessenich [Sat, 28 Oct 2017 18:55:02 +0000 (12:55 -0600)]
Tests: Non-determinancy: Add back in the IntMin tests.

7 years agoMerge pull request #1133 from greg-lunarg/kg2
John Kessenich [Sat, 28 Oct 2017 08:03:09 +0000 (02:03 -0600)]
Merge pull request #1133 from greg-lunarg/kg2

Add python3 compatibility to update_glslang_sources.py

7 years agoAdd python3 compatibility to update_glslang_sources.py
GregF [Fri, 27 Oct 2017 21:39:45 +0000 (15:39 -0600)]
Add python3 compatibility to update_glslang_sources.py

7 years agoNon-determinant tests: Remove recent tests, to see if things stabelize.
John Kessenich [Fri, 27 Oct 2017 10:15:57 +0000 (04:15 -0600)]
Non-determinant tests: Remove recent tests, to see if things stabelize.

Both debug and release clang builds have segfaulted on recent
changes, non deterministically, while doing the single/multi-thread
test all test files. Removing recent test files, to see if it gives
a clue.

7 years agoNon-functional: Add {} expected by convention; retrigger failed bot tests.
John Kessenich [Fri, 27 Oct 2017 09:10:21 +0000 (03:10 -0600)]
Non-functional: Add {} expected by convention; retrigger failed bot tests.

7 years agoMerge pull request #1129 from xorgy/const-fold-int-min-modulo-negative-one
John Kessenich [Fri, 27 Oct 2017 07:30:03 +0000 (01:30 -0600)]
Merge pull request #1129 from xorgy/const-fold-int-min-modulo-negative-one

GLSL: Fold constant SHRT_MIN/INT_MIN/LLONG_MIN % -1 to 0.

7 years agoGLSL: Fold constant SHRT_MIN/INT_MIN/LLONG_MIN % -1 to 0.
Aaron Muir Hamilton [Wed, 25 Oct 2017 00:11:53 +0000 (00:11 +0000)]
GLSL: Fold constant SHRT_MIN/INT_MIN/LLONG_MIN % -1 to 0.

7 years agoMerge pull request #1124 from xorgy/check-inner-implicit-atomic-uint
John Kessenich [Tue, 24 Oct 2017 14:18:09 +0000 (08:18 -0600)]
Merge pull request #1124 from xorgy/check-inner-implicit-atomic-uint

GLSL: Check for implicit inner dimension in array of atomic_uint.

7 years agoMerge pull request #1127 from xorgy/preprocessor-int-min-mod-negative-one
John Kessenich [Tue, 24 Oct 2017 14:14:38 +0000 (08:14 -0600)]
Merge pull request #1127 from xorgy/preprocessor-int-min-mod-negative-one

Preprocessor: Evaluate INT_MIN % -1 to 0.

7 years agoPreprocessor: Evaluate INT_MIN % -1 to 0.
Aaron Muir Hamilton [Tue, 24 Oct 2017 10:59:01 +0000 (10:59 +0000)]
Preprocessor: Evaluate INT_MIN % -1 to 0.

7 years agoMerge pull request #1125 from greg-lunarg/kg1
John Kessenich [Tue, 24 Oct 2017 04:11:42 +0000 (22:11 -0600)]
Merge pull request #1125 from greg-lunarg/kg1

Update spirv-tools known-good

7 years agoUpdate spirv-tools known-good
GregF [Mon, 23 Oct 2017 22:48:42 +0000 (16:48 -0600)]
Update spirv-tools known-good

7 years agoGLSL: Check for implicit inner dimension in array of atomic_uint.
Aaron Muir Hamilton [Mon, 23 Oct 2017 15:31:10 +0000 (15:31 +0000)]
GLSL: Check for implicit inner dimension in array of atomic_uint.

7 years agoMerge pull request #1118 from xorgy/only-swizzle-numbers-and-bools
John Kessenich [Mon, 23 Oct 2017 05:28:22 +0000 (23:28 -0600)]
Merge pull request #1118 from xorgy/only-swizzle-numbers-and-bools

Only try swizzles on vectors, numbers, and booleans.

7 years agoMerge branch 'only-parse-inf-constant-in-hlsl' of https://github.com/xorgy/glslang...
John Kessenich [Mon, 23 Oct 2017 05:19:02 +0000 (23:19 -0600)]
Merge branch 'only-parse-inf-constant-in-hlsl' of https://github.com/xorgy/glslang into xorgy-only-parse-inf-constant-in-hlsl

7 years agoTests: Add test for GLSL +-#INF.
John Kessenich [Mon, 23 Oct 2017 05:17:18 +0000 (23:17 -0600)]
Tests: Add test for GLSL +-#INF.

7 years agoMerge pull request #1120 from xorgy/overlong-hex-literal
John Kessenich [Mon, 23 Oct 2017 05:09:32 +0000 (23:09 -0600)]
Merge pull request #1120 from xorgy/overlong-hex-literal

Check for hexadecimal literals exceeding MaxTokenLength.

7 years agoGLSL: Only parse [-]1.#INF in HLSL mode.
Aaron Muir Hamilton [Mon, 23 Oct 2017 02:56:27 +0000 (02:56 +0000)]
GLSL: Only parse [-]1.#INF in HLSL mode.

7 years agoCheck for hexadecimal literals exceeding MaxTokenLength.
Aaron Muir Hamilton [Sun, 22 Oct 2017 17:41:13 +0000 (17:41 +0000)]
Check for hexadecimal literals exceeding MaxTokenLength.

7 years agoOnly try swizzles on vectors, numbers, and booleans.
Aaron Muir Hamilton [Sat, 21 Oct 2017 19:13:42 +0000 (19:13 +0000)]
Only try swizzles on vectors, numbers, and booleans.

7 years agoMerge pull request #1115 from LoopDawg/stdarray-binding-set
John Kessenich [Fri, 20 Oct 2017 22:31:26 +0000 (16:31 -0600)]
Merge pull request #1115 from LoopDawg/stdarray-binding-set

Nonfunctional: minor: use std::array for per-set shifts, fix warning.

7 years agoNonfunctional: minor: use std::array for per-set shifts, fix warning.
LoopDawg [Fri, 20 Oct 2017 18:02:38 +0000 (12:02 -0600)]
Nonfunctional: minor: use std::array for per-set shifts, fix warning.

Two unrelated, minor tweaks:

(1) Use std::array for shiftBindingForSet.  Now matches shiftBinding.
(2) Add parens in shouldFlatten() to make compiler warning happy.

7 years agoMerge pull request #1111 from LoopDawg/per-set-binding-offsets
John Kessenich [Fri, 20 Oct 2017 17:35:29 +0000 (11:35 -0600)]
Merge pull request #1111 from LoopDawg/per-set-binding-offsets

Add per-descriptor-set IO mapping shift values.

7 years agoSPV: Don't emit StorageImageMultisample capability for subpass images.
John Kessenich [Fri, 20 Oct 2017 16:56:50 +0000 (10:56 -0600)]
SPV: Don't emit StorageImageMultisample capability for subpass images.

7 years agoNon-functional: missing comments from missed git add.
John Kessenich [Fri, 20 Oct 2017 16:56:20 +0000 (10:56 -0600)]
Non-functional: missing comments from missed git add.

7 years agoHLSL: Fix #1106. Support shader setting of binding/set for $Global.
John Kessenich [Thu, 19 Oct 2017 22:54:25 +0000 (16:54 -0600)]
HLSL: Fix #1106. Support shader setting of binding/set for $Global.

7 years agoAdd per-descriptor-set IO mapping shift values.
LoopDawg [Wed, 18 Oct 2017 01:27:14 +0000 (19:27 -0600)]
Add per-descriptor-set IO mapping shift values.

This PR adds the ability to provide per-descriptor-set IO mapping shift
values.  If a particular binding does not land into a per-set value,
then it falls back to the prior behavior (global shifts per resource class).

Because there were already 6 copies of many different methods and internal
variables and functions, and this PR would have added 6 more, a new API is
introduced to cut down on replication and present a cleaner interface.
For the global (non-set-specific) API, the old entry points still exist
for backward compatibility, but are phrased internally in terms of the
following.

    // Resource type for IO resolver
    enum TResourceType {
        EResSampler,
        EResTexture,
        EResImage,
        EResUbo,
        EResSsbo,
        EResUav,
        EResCount
    };

Methods on TShader:

    void setShiftBinding(TResourceType res, unsigned int base);
    void setShiftBindingForSet(TResourceType res, unsigned int set, unsigned int base);

The first method replaces the 6 prior entry points of various spellings, which
exist now in depreciated form.  The second provides per-resource-set functionality.
Both accept an enum from the list above.

From the command line, the existing options can accept either a single shift value as
before, or a series of 1 or more [set offset] pairs.  Both can be provided, as in:

    ... --stb 20 --stb 2 25 3 30 ...

which will use the offset 20 for anything except descriptor set 2 (which uses 25) and
3 (which uses 30).

7 years agoGLSL->SPIR-V: Put precision decorations on imageLoad().
John Kessenich [Thu, 19 Oct 2017 08:07:30 +0000 (02:07 -0600)]
GLSL->SPIR-V: Put precision decorations on imageLoad().

7 years agoGLSL: Make sampling operations have agnostic precision qualifiers for desktop.
John Kessenich [Thu, 19 Oct 2017 06:26:39 +0000 (00:26 -0600)]
GLSL: Make sampling operations have agnostic precision qualifiers for desktop.

Desktop defaults to highp for samplers, but this should not apply to the built-in
functions, so make it appy only to user declarations.

7 years agoMerge pull request #1113 from xorgy/preprocessor-int-min-over-negative-one
John Kessenich [Thu, 19 Oct 2017 06:24:05 +0000 (00:24 -0600)]
Merge pull request #1113 from xorgy/preprocessor-int-min-over-negative-one

Preprocessor: Evaluate INT_MIN / -1 to 0.

7 years agoMerge pull request #1102 from KhronosGroup/partially-flatten
John Kessenich [Wed, 18 Oct 2017 20:53:53 +0000 (14:53 -0600)]
Merge pull request #1102 from KhronosGroup/partially-flatten

HLSL: Partially flatten hierarchies, instead of all or nothing.

7 years agoPreprocessor: Evaluate INT_MIN / -1 to 0.
Aaron Muir Hamilton [Wed, 18 Oct 2017 19:33:00 +0000 (19:33 +0000)]
Preprocessor: Evaluate INT_MIN / -1 to 0.

  This division is undefined behaviour which raises SIGFPE on x86.
  Most C++ preprocessors evaluate this silently to 0.

7 years agoBuild: Fix build warning.
John Kessenich [Tue, 17 Oct 2017 18:27:51 +0000 (12:27 -0600)]
Build: Fix build warning.

7 years agoMerge pull request #1109 from xorgy/never-try-to-swizzle-void
John Kessenich [Tue, 17 Oct 2017 15:03:17 +0000 (09:03 -0600)]
Merge pull request #1109 from xorgy/never-try-to-swizzle-void

GLSL: Don't try to swizzle void.

7 years agoDon't try to swizzle void.
Aaron Muir Hamilton [Tue, 17 Oct 2017 08:11:33 +0000 (08:11 +0000)]
Don't try to swizzle void.

7 years agoUpdate spirv-tools known-good
GregF [Mon, 16 Oct 2017 16:53:53 +0000 (10:53 -0600)]
Update spirv-tools known-good

7 years agoPP: Fix #1104: Missing check for #if overflow.
John Kessenich [Mon, 16 Oct 2017 21:29:07 +0000 (15:29 -0600)]
PP: Fix #1104: Missing check for #if overflow.

Also, rationalized this to generally make it safer and more readable.
It could use a more modern approach, at some point...

7 years agoHLSL: More clip fix: It is more involved than previous commit. Complete.
John Kessenich [Mon, 16 Oct 2017 19:11:53 +0000 (13:11 -0600)]
HLSL: More clip fix: It is more involved than previous commit. Complete.

7 years agoFix #1103: clip() works on int/uint.
John Kessenich [Mon, 16 Oct 2017 17:42:35 +0000 (11:42 -0600)]
Fix #1103: clip() works on int/uint.

7 years agoTests: Add clip(int) tests.
John Kessenich [Mon, 16 Oct 2017 17:35:11 +0000 (11:35 -0600)]
Tests: Add clip(int) tests.

7 years agoInfrastructure: Add a TShader method to publicly expose the intermediate.
John Kessenich [Fri, 13 Oct 2017 05:12:40 +0000 (23:12 -0600)]
Infrastructure: Add a TShader method to publicly expose the intermediate.

Fixes #1088.

7 years agoHLSL: Partially flatten hierarchies, instead of all or nothing.
John Kessenich [Wed, 11 Oct 2017 20:03:45 +0000 (14:03 -0600)]
HLSL: Partially flatten hierarchies, instead of all or nothing.

Fixes #1092.  Allows arrays of opaques to keep arrayness, unless
needed by uniform array flattening.
Can handle assignments of mixed amounts of flattening.

7 years agoMerge pull request #1098 from LoopDawg/attribute-gets
John Kessenich [Wed, 11 Oct 2017 03:05:06 +0000 (06:05 +0300)]
Merge pull request #1098 from LoopDawg/attribute-gets

HLSL: nonfunctional: add helper access methods to TAttributeMap

7 years agoMerge pull request #1097 from SWIFTingAround/master
John Kessenich [Tue, 10 Oct 2017 22:54:06 +0000 (01:54 +0300)]
Merge pull request #1097 from SWIFTingAround/master

Set cmake-policy CMP0048 to NEW

7 years agoMerge pull request #1094 from LoopDawg/split-shadow-tx
John Kessenich [Tue, 10 Oct 2017 22:48:49 +0000 (01:48 +0300)]
Merge pull request #1094 from LoopDawg/split-shadow-tx

HLSL: nonfunctional: rename setId -> switchId, add comment

7 years agoMerge pull request #1080 from hedejing/master
John Kessenich [Tue, 10 Oct 2017 22:48:04 +0000 (01:48 +0300)]
Merge pull request #1080 from hedejing/master

Add getAsLoopNode() method for TIntermLoop

7 years agoHLSL: add helper access methods to TAttributeMap
LoopDawg [Tue, 10 Oct 2017 20:59:40 +0000 (14:59 -0600)]
HLSL: add helper access methods to TAttributeMap

There was some code replication around getting string and integer
values out of an attribute map.  This adds new methods to the
TAttributeMap class to encapsulate some accessor details.

7 years agoSet cmake-policy CMP0048 to NEW
Tim Diekmann [Tue, 10 Oct 2017 14:26:31 +0000 (16:26 +0200)]
Set cmake-policy CMP0048 to NEW

7 years agoAdd getAsLoopNode() method for Loop node
He Dejing [Mon, 2 Oct 2017 18:41:23 +0000 (02:41 +0800)]
Add getAsLoopNode() method for Loop node

follow local conventions of spaces

7 years agoHLSL: nonfunctional: rename setId -> switchId, add comment
LoopDawg [Sat, 7 Oct 2017 22:42:37 +0000 (16:42 -0600)]
HLSL: nonfunctional: rename setId -> switchId, add comment

Method rename, add comment about its intended use.  No
test diffs.

7 years agoHLSL: Validate implicit initializer assignment to opaque members.
John Kessenich [Sat, 7 Oct 2017 19:23:09 +0000 (13:23 -0600)]
HLSL: Validate implicit initializer assignment to opaque members.

Fixes #1091.

7 years agoSPV: GeneratorVersion: bump version number because of atomic decrement change.
John Kessenich [Sat, 7 Oct 2017 17:33:11 +0000 (11:33 -0600)]
SPV: GeneratorVersion: bump version number because of atomic decrement change.

7 years agoMerge pull request #1090 from tafuri/#1084-fix-segfault
John Kessenich [Sat, 7 Oct 2017 04:19:21 +0000 (07:19 +0300)]
Merge pull request #1090 from tafuri/#1084-fix-segfault

Only track variables in the global scope

7 years agoSPV: Correct semantics of atomic-counter decrement.
John Kessenich [Sat, 7 Oct 2017 03:21:48 +0000 (21:21 -0600)]
SPV: Correct semantics of atomic-counter decrement.

The semantics differ between GLSL/HLSL and SPIR-V.
Translate between these.

7 years agoHLSL: Tests: Add subset of flattened opaque test to legalize results.
John Kessenich [Sat, 7 Oct 2017 03:01:07 +0000 (21:01 -0600)]
HLSL: Tests: Add subset of flattened opaque test to legalize results.

7 years agoAdded test for local structured buffer variable
Sebastian Tafuri [Fri, 6 Oct 2017 22:47:54 +0000 (00:47 +0200)]
Added test for local structured buffer variable

7 years agoFixed formatting
Sebastian Tafuri [Fri, 6 Oct 2017 22:12:50 +0000 (00:12 +0200)]
Fixed formatting

7 years agoMerge pull request #1089 from LoopDawg/split-shadow-tx
John Kessenich [Fri, 6 Oct 2017 21:33:20 +0000 (00:33 +0300)]
Merge pull request #1089 from LoopDawg/split-shadow-tx

HLSL: split textures used for both shadow and non-shadow modes

7 years agoOnly track variables in the global scope
Sebastian Tafuri [Fri, 6 Oct 2017 20:45:00 +0000 (22:45 +0200)]
Only track variables in the global scope

7 years agoHLSL: split textures used for both shadow and non-shadow modes
LoopDawg [Thu, 5 Oct 2017 22:25:52 +0000 (16:25 -0600)]
HLSL: split textures used for both shadow and non-shadow modes

A single texture can statically appear in code mixed with a shadow sampler
and a non-shadow sampler.  This would be create invalid SPIR-V, unless
one of them is provably dead.

The previous detection of this happened before DCE, so some shaders would
trigger the error even though they wouldn't after DCE.  To handle that
case, this PR splits the texture into two: one with each mode.  It sets
"needsLegalization" (if that happens for any texture) to warn that this shader
will need post-compilation legalization.

If the texture is only used with one of the two modes, behavior is as it
was before.

7 years agoReadme: Update with additional Windows build information for SPIRV-tools build.
John Kessenich [Fri, 6 Oct 2017 06:24:41 +0000 (00:24 -0600)]
Readme: Update with additional Windows build information for SPIRV-tools build.

7 years agoMerge pull request #1085 from KhronosGroup/flatten-assign-subset
John Kessenich [Wed, 4 Oct 2017 20:41:08 +0000 (23:41 +0300)]
Merge pull request #1085 from KhronosGroup/flatten-assign-subset

HLSL: Fix #954: Track/access subsets of flattened multi-level aggrega…

7 years agoHLSL: Fix #954: Track/access subsets of flattened multi-level aggregates.
John Kessenich [Wed, 4 Oct 2017 19:27:43 +0000 (13:27 -0600)]
HLSL: Fix #954: Track/access subsets of flattened multi-level aggregates.

Works in conjuction with d1be754 to represent and modify a partially
dereferenced multi-level flattened aggregate.

7 years agoMerge pull request #1081 from xxxbxxx/for-upstream-1
John Kessenich [Wed, 4 Oct 2017 19:01:25 +0000 (22:01 +0300)]
Merge pull request #1081 from xxxbxxx/for-upstream-1

HLSL: Fix crash when flattening both side of assignement simultaneously.

7 years agoHLSL: Fix crash when flattening both side of assignement simultaneously.
Unknown [Tue, 3 Oct 2017 07:10:26 +0000 (09:10 +0200)]
HLSL: Fix crash when flattening both side of assignement simultaneously.

7 years agoMerge pull request #1075 from LoopDawg/subpass-input
John Kessenich [Mon, 2 Oct 2017 22:47:48 +0000 (01:47 +0300)]
Merge pull request #1075 from LoopDawg/subpass-input

HLSL: add subpass input types and methods

7 years agoHLSL: add subpass input types and methods
LoopDawg [Wed, 27 Sep 2017 15:04:43 +0000 (09:04 -0600)]
HLSL: add subpass input types and methods

Add support for Subpass Input proposal of issue #1069.

Subpass input types are given as:

    layout(input_attachment_index = 1) SubpassInput<float4> subpass_f;
    layout(input_attachment_index = 2) SubpassInput<int4>   subpass_i;
    layout(input_attachment_index = 3) SubpassInput<uint4>  subpass_u;

    layout(input_attachment_index = 1) SubpassInputMS<float4> subpass_ms_f;
    layout(input_attachment_index = 2) SubpassInputMS<int4>   subpass_ms_i;
    layout(input_attachment_index = 3) SubpassInputMS<uint4>  subpass_ms_u;

The input attachment may also be specified using attribute syntax:

    [[vk::input_attachment_index(7)]] SubpassInput subpass_2;

The template type may be a shorter-than-vec4 vector, but currently user
structs are not supported.  (An unimplemented error will be issued).

The load operations are methods on objects of the above type:

    float4 result = subpass_f.SubpassLoad();
    int4   result = subpass_i.SubpassLoad();
    uint4  result = subpass_u.SubpassLoad();

    float4 result = subpass_ms_f.SubpassLoad(samp);
    int4   result = subpass_ms_i.SubpassLoad(samp);
    uint4  result = subpass_ms_u.SubpassLoad(samp);

Additionally, the AST printer could not print EOpSubpass* nodes.  Now it can.

Fixes #1069

7 years agoBuild: Fix a couple build issues.
John Kessenich [Sat, 30 Sep 2017 20:54:18 +0000 (14:54 -0600)]
Build: Fix a couple build issues.

7 years agoHLSL: Additional attribute support: [[]], namespace, parameters:
John Kessenich [Sat, 30 Sep 2017 20:34:50 +0000 (14:34 -0600)]
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

7 years agoFix #1060: Could crash if using --source-entry-point with -e; fixed.
John Kessenich [Fri, 29 Sep 2017 23:51:52 +0000 (17:51 -0600)]
Fix #1060: Could crash if using --source-entry-point with -e; fixed.

7 years agoMerge pull request #1078 from greg-lunarg/addopt14
John Kessenich [Fri, 29 Sep 2017 17:57:30 +0000 (20:57 +0300)]
Merge pull request #1078 from greg-lunarg/addopt14

Remove opaque workarounds

7 years agoLegalization: Fix tests after workarounds removed
GregF [Fri, 29 Sep 2017 16:08:20 +0000 (10:08 -0600)]
Legalization: Fix tests after workarounds removed

7 years agoSPV: rationalize parameter handling for "original" and "writable" parameters.
John Kessenich [Sun, 10 Sep 2017 21:21:05 +0000 (15:21 -0600)]
SPV: rationalize parameter handling for "original" and "writable" parameters.

7 years agoHLSL: Pass opaques by local copy, instead of by interface original.
John Kessenich [Fri, 8 Sep 2017 08:38:07 +0000 (02:38 -0600)]
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.

7 years agoHLSL: Remove workarounds for assigning to opaques.
John Kessenich [Thu, 7 Sep 2017 10:33:11 +0000 (04:33 -0600)]
HLSL: Remove workarounds for assigning to opaques.

This assumes it will be combined with optimizing transforms
that eliminate assignments to opaques.

7 years agoMerge pull request #1076 from LoopDawg/shadow-tx-types
John Kessenich [Fri, 29 Sep 2017 02:07:50 +0000 (05:07 +0300)]
Merge pull request #1076 from LoopDawg/shadow-tx-types

HLSL: force textures to shadow modes from combined samplers

7 years agoHLSL: force textures to shadow modes from combined samplers
LoopDawg [Wed, 27 Sep 2017 15:12:51 +0000 (09:12 -0600)]
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.

7 years agoMerge pull request #1077 from greg-lunarg/addopt12
John Kessenich [Thu, 28 Sep 2017 19:38:29 +0000 (22:38 +0300)]
Merge pull request #1077 from greg-lunarg/addopt12

Legalization: Fix warnings and disable tests when spirv-tools not present

7 years agoLegalization: Fix warnings and disable tests when spirv-tools not present
GregF [Thu, 28 Sep 2017 16:08:32 +0000 (10:08 -0600)]
Legalization: Fix warnings and disable tests when spirv-tools not present

7 years agoMerge pull request #1070 from greg-lunarg/addopt8
John Kessenich [Thu, 28 Sep 2017 02:56:56 +0000 (05:56 +0300)]
Merge pull request #1070 from greg-lunarg/addopt8

Enable HLSL legalization

7 years agoAdvance spirv-opt known-good to hopefully fix travis multithread failure
GregF [Wed, 27 Sep 2017 21:46:59 +0000 (15:46 -0600)]
Advance spirv-opt known-good to hopefully fix travis multithread failure

7 years agoLegalization: Skip spirv-tools tests
GregF [Wed, 27 Sep 2017 17:34:48 +0000 (11:34 -0600)]
Legalization: Skip spirv-tools tests

7 years agoPick up latest spirv-tools in attempt to fix travis failures
GregF [Mon, 25 Sep 2017 19:50:32 +0000 (13:50 -0600)]
Pick up latest spirv-tools in attempt to fix travis failures

7 years agoTry Python interpreter on update_glslang_sources.py in appveyor
GregF [Fri, 22 Sep 2017 23:21:37 +0000 (17:21 -0600)]
Try Python interpreter on update_glslang_sources.py in appveyor

7 years agoFix travis and appveyor calls to update_glslang_sources.py
GregF [Fri, 22 Sep 2017 21:30:10 +0000 (15:30 -0600)]
Fix travis and appveyor calls to update_glslang_sources.py

7 years agoEnable HLSL legalization
GregF [Fri, 22 Sep 2017 00:40:22 +0000 (18:40 -0600)]
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.

7 years agoMerge pull request #1072 from amdrexu/feature
John Kessenich [Wed, 27 Sep 2017 15:11:06 +0000 (18:11 +0300)]
Merge pull request #1072 from amdrexu/feature

Implement extension GL_NV_shader_atomic_int64

7 years agoImplement extension GL_NV_shader_atomic_int64
Rex Xu [Tue, 26 Sep 2017 07:42:56 +0000 (15:42 +0800)]
Implement extension GL_NV_shader_atomic_int64

7 years agoMerge pull request #1071 from antiagainst/ninja-make
John Kessenich [Tue, 26 Sep 2017 06:08:30 +0000 (00:08 -0600)]
Merge pull request #1071 from antiagainst/ninja-make

Travis: use make instead of ninja

7 years agoTravis: use make instead of ninja and limit concurrent jobs
Lei Zhang [Mon, 25 Sep 2017 18:04:20 +0000 (14:04 -0400)]
Travis: use make instead of ninja and limit concurrent jobs

7 years agoMerge pull request #1063 from LoopDawg/remapper-error-cleanup
John Kessenich [Sat, 23 Sep 2017 12:32:02 +0000 (06:32 -0600)]
Merge pull request #1063 from LoopDawg/remapper-error-cleanup

Remapper: make remapper robust against non-exiting error handlers

7 years agoBuild: Merge pull request #1068 from greg-lunarg/addopt4
John Kessenich [Fri, 22 Sep 2017 19:51:02 +0000 (13:51 -0600)]
Build: Merge pull request #1068 from greg-lunarg/addopt4

CMake file changes for SPIR-V legalization for HLSL

7 years agoCMake changes for HLSL legalization
GregF [Thu, 21 Sep 2017 22:50:39 +0000 (16:50 -0600)]
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.

7 years agoRemapper: make remapper robust against non-exiting error handlers
LoopDawg [Sun, 17 Sep 2017 16:38:52 +0000 (10:38 -0600)]
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.

7 years agoHLSL: Fix #1064: Don't include empty structures on OpEntryPoint
John Kessenich [Tue, 19 Sep 2017 17:09:59 +0000 (11:09 -0600)]
HLSL: Fix #1064: Don't include empty structures on OpEntryPoint

7 years agoMerge pull request #1044 from dsrbecky/image_external_essl3
John Kessenich [Sat, 16 Sep 2017 03:10:08 +0000 (21:10 -0600)]
Merge pull request #1044 from dsrbecky/image_external_essl3

Add support for GL_OES_EGL_image_external_essl3

7 years agoHLSL: fix array[1] of vec4 constant declaration.
xavier [Sun, 20 Aug 2017 08:44:21 +0000 (10:44 +0200)]
HLSL: fix array[1] of vec4 constant declaration.

7 years agoTest: Make another test legal HLSL, and rationalize GLSL vs HLSL addConstructor().
John Kessenich [Fri, 15 Sep 2017 19:15:23 +0000 (13:15 -0600)]
Test: Make another test legal HLSL, and rationalize GLSL vs HLSL addConstructor().

7 years agoHLSL: Add bounds checking, shared with GLSL. Partially address #1032.
John Kessenich [Fri, 15 Sep 2017 01:45:28 +0000 (19:45 -0600)]
HLSL: Add bounds checking, shared with GLSL. Partially address #1032.

7 years agoMerge pull request #1051 from LoopDawg/bug-1049
John Kessenich [Fri, 15 Sep 2017 00:18:19 +0000 (18:18 -0600)]
Merge pull request #1051 from LoopDawg/bug-1049

HLSL: allow split type in InputPatch template type, & HS return types.