platform/upstream/glslang.git
6 years agoUsage: clarify meaning of -s; fixes #1135.
John Kessenich [Fri, 17 Nov 2017 05:32:20 +0000 (22:32 -0700)]
Usage: clarify meaning of -s; fixes #1135.

6 years agoTest: Add more legalization tests; those effected by flattening.
John Kessenich [Thu, 16 Nov 2017 22:02:06 +0000 (15:02 -0700)]
Test: Add more legalization tests; those effected by flattening.

6 years agoMerge pull request #1156 from LoopDawg/snorm-uav
John Kessenich [Wed, 15 Nov 2017 22:30:59 +0000 (15:30 -0700)]
Merge pull request #1156 from LoopDawg/snorm-uav

HLSL: Accept unorm and snorm on types

6 years agoMerge pull request #1157 from LoopDawg/gs-hs-mix
John Kessenich [Wed, 15 Nov 2017 22:30:18 +0000 (15:30 -0700)]
Merge pull request #1157 from LoopDawg/gs-hs-mix

HLSL: ignore geometry attributes on non-GS stages.

6 years agoHLSL: ignore geometry attributes on non-GS stages.
LoopDawg [Wed, 15 Nov 2017 18:33:25 +0000 (11:33 -0700)]
HLSL: ignore geometry attributes on non-GS stages.

If a shader includes a mixture of several stages, such as HS and GS,
the non-stage output geometry should be ignored, lest it conflict
with the stage output.

6 years agoMerge pull request #1147 from KhronosGroup/memory1
John Kessenich [Wed, 15 Nov 2017 04:26:42 +0000 (21:26 -0700)]
Merge pull request #1147 from KhronosGroup/memory1

Memory fixes, round 1

6 years agoMerge pull request #1155 from antiagainst/skip-tags
John Kessenich [Tue, 14 Nov 2017 22:43:24 +0000 (15:43 -0700)]
Merge pull request #1155 from antiagainst/skip-tags

Appveyor: avoid double testing on master commits

6 years agoMemory: Remove redundant pool popAll(), which is potentially confusing.
John Kessenich [Tue, 14 Nov 2017 22:19:41 +0000 (15:19 -0700)]
Memory: Remove redundant pool popAll(), which is potentially confusing.

6 years agoHLSL: Accept unorm and snorm on types
LoopDawg [Tue, 14 Nov 2017 21:55:40 +0000 (14:55 -0700)]
HLSL: Accept unorm and snorm on types

This is currently parsed and ignored, save for some minor validation.

6 years agoAppveyor: avoid double testing on master commits
Lei Zhang [Tue, 14 Nov 2017 19:36:22 +0000 (14:36 -0500)]
Appveyor: avoid double testing on master commits

6 years agoImplement OS_DumpMemoryCounters for Linux
LoopDawg [Mon, 13 Nov 2017 22:54:12 +0000 (15:54 -0700)]
Implement OS_DumpMemoryCounters for Linux

6 years agoMemory: Restore unused interfaces, in case other tools called them.
John Kessenich [Tue, 14 Nov 2017 05:19:21 +0000 (22:19 -0700)]
Memory: Restore unused interfaces, in case other tools called them.

6 years agoMerge pull request #1150 from antiagainst/readme-release
John Kessenich [Tue, 14 Nov 2017 04:43:45 +0000 (21:43 -0700)]
Merge pull request #1150 from antiagainst/readme-release

Update README about the automatic master-tot relase

6 years agoUpdate README about the automatic master-tot relase
Lei Zhang [Mon, 13 Nov 2017 20:27:32 +0000 (15:27 -0500)]
Update README about the automatic master-tot relase

6 years agoMerge pull request #1143 from LoopDawg/texturebuffer
John Kessenich [Mon, 13 Nov 2017 18:20:34 +0000 (11:20 -0700)]
Merge pull request #1143 from LoopDawg/texturebuffer

WIP: HLSL: implement TextureBuffer<type>

6 years agoMemory: Add loop around main, to test tear-down and reuse, and monitor memory changes.
John Kessenich [Mon, 13 Nov 2017 08:32:06 +0000 (01:32 -0700)]
Memory: Add loop around main, to test tear-down and reuse, and monitor memory changes.

6 years agoMemory: Remove the need for per-thread tear down.
John Kessenich [Mon, 13 Nov 2017 06:12:57 +0000 (23:12 -0700)]
Memory: Remove the need for per-thread tear down.

Make key objects using the memory pool own their own pool and delete it,
such that there is not generic per-thread pool to manage.

6 years agoMemory: Do process and 1st thread tear down.
John Kessenich [Sun, 12 Nov 2017 22:55:22 +0000 (15:55 -0700)]
Memory: Do process and 1st thread tear down.

Addresses #928, #389, and 1st item in #976. Overlaps #916.

This had been dropped, when moving away from the old Win32 DLL model.

Issue: per-thread tear down for other threads.

6 years agoMemory: Move to a normal model of ownership of memory pools, for new/delete.
John Kessenich [Sun, 12 Nov 2017 22:43:03 +0000 (15:43 -0700)]
Memory: Move to a normal model of ownership of memory pools, for new/delete.

Addresses step 4 of #976, overlaps #916.

For each pool, now, it is newed, remembered, and freed by the same entity,
rather than having a mix (thread finalize freeing current pool) that could
lead to double freeing of the same pool. It is quite rational and simple now.

This will enable reinstalling process and thread tear down.

6 years agoMemory: Non-Functional: Rationalize and improve encapsulation of TLS usage.
John Kessenich [Sun, 12 Nov 2017 22:28:58 +0000 (15:28 -0700)]
Memory: Non-Functional: Rationalize and improve encapsulation of TLS usage.

This will make the next (functional) commit easier to see.

6 years agoMerge pull request #1142 from greg-lunarg/kg3
John Kessenich [Fri, 10 Nov 2017 20:52:00 +0000 (13:52 -0700)]
Merge pull request #1142 from greg-lunarg/kg3

Update spirv-tools known good.

6 years agoMerge pull request #1145 from antiagainst/travis-auto-deploy
John Kessenich [Fri, 10 Nov 2017 02:19:56 +0000 (19:19 -0700)]
Merge pull request #1145 from antiagainst/travis-auto-deploy

Travis: auto deploy build artifacts to GitHub Releases

6 years agoTravis: auto deploy build artifacts to GitHub Releases
Lei Zhang [Thu, 9 Nov 2017 02:32:01 +0000 (21:32 -0500)]
Travis: auto deploy build artifacts to GitHub Releases

Pushing a commit to the master branch will trigger a build on
Travis. If the build is successful, the artifacts will be
collected and pushed to GitHub Releases, under the "master-tot"
release.

6 years agoMerge pull request #1114 from LoopDawg/validator-script
John Kessenich [Thu, 9 Nov 2017 19:10:24 +0000 (12:10 -0700)]
Merge pull request #1114 from LoopDawg/validator-script

Add script to crank test shaders through spirv-val

6 years agoMerge pull request #1116 from LoopDawg/reverse-shift-args
John Kessenich [Thu, 9 Nov 2017 19:08:28 +0000 (12:08 -0700)]
Merge pull request #1116 from LoopDawg/reverse-shift-args

Reverse order of setShiftBindingForSet parameters

6 years agoMerge pull request #1144 from antiagainst/appveyor-auto-deploy
John Kessenich [Thu, 9 Nov 2017 19:07:42 +0000 (12:07 -0700)]
Merge pull request #1144 from antiagainst/appveyor-auto-deploy

Appveyor: auto deploy build artifacts to GitHub Releases

6 years agoReverse order of setShiftBindingForSet parameters
LoopDawg [Sat, 21 Oct 2017 16:46:39 +0000 (10:46 -0600)]
Reverse order of setShiftBindingForSet parameters

Per feedback on PR #1111, this reverses the order of the parameters for the setShiftBinding API.

It is now:

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

6 years agoAdd script to crank test shaders through spirv-val
LoopDawg [Thu, 19 Oct 2017 18:09:56 +0000 (12:09 -0600)]
Add script to crank test shaders through spirv-val

This script will crank a supplied set of glslang test shaders through the
spirv-val tool, reporting on the results.

There are some important things to note:

* Like 'runtests', this must be invoked from the 'Test' subdirectory.

* This is mostly useful on the hlsl.* tests, although it is not strictly
limited to those.  The reason is that most of the glsl tests either contain
validation error cases, and so fail to compile, or are not using a #version
compatible with producing SPIR-V modules.

* Some tests, such as negative tests, or most of the glsl tests, have
intentional compilation errors.  This script treats that as OK.  Failures
are successfully compiling shaders which proceed to fail spirv-val.

* spirv-val is looked for in either the External directory, or if not
found there, in a sibling directory of glslang, and if not found there
either, in /usr/local/bin.

* There are a bunch of command line options.  ./validate-shaders.sh --help
will describe them.

Some examples to try:

   ./validate-shaders.sh hlsl.*   # exercise all hlsl.* tests.
   ./validate-shaders.sh --terse hlsl.*  # same, but tersely.

   # dump validator results for problems in something.frag:
   ./validate-shaders.sh --quiet --dump-val something.frag

6 years agoAppveyor: auto deploy build artifacts to GitHub Releases
Lei Zhang [Wed, 8 Nov 2017 22:26:51 +0000 (17:26 -0500)]
Appveyor: auto deploy build artifacts to GitHub Releases

Pushing a commit to the master branch will trigger a build on
Appveyor. If the build is successful, the artifacts will be
collected and pushed to GitHub Releases, under the "master-tot"
release.

6 years agoHLSL: implement TextureBuffer<type>
LoopDawg [Thu, 9 Nov 2017 02:48:11 +0000 (19:48 -0700)]
HLSL: implement TextureBuffer<type>

Almost equivalent to tbuffer, except members not at global scope.
So, reference is "TextureBuffer_var.member", not simply "member".

6 years agoUpdate spirv-tools known good.
GregF [Wed, 8 Nov 2017 20:56:08 +0000 (13:56 -0700)]
Update spirv-tools known good.

6 years agoSPV: Don't support noise*() when generating SPV.
John Kessenich [Fri, 3 Nov 2017 09:39:48 +0000 (03:39 -0600)]
SPV: Don't support noise*() when generating SPV.

6 years agoErrors: Have a whole set of tool-level error messages report to stderr.
John Kessenich [Fri, 3 Nov 2017 04:48:15 +0000 (22:48 -0600)]
Errors: Have a whole set of tool-level error messages report to stderr.

6 years agoVersioning: Update some version strings. Still need better overall version.
John Kessenich [Fri, 3 Nov 2017 04:32:14 +0000 (22:32 -0600)]
Versioning: Update some version strings. Still need better overall version.

6 years agoMerge pull request #1139 from greg-lunarg/remap2
John Kessenich [Fri, 3 Nov 2017 03:53:25 +0000 (21:53 -0600)]
Merge pull request #1139 from greg-lunarg/remap2

Remapper: Fix strip algo when strip ranges overlap

6 years agoRemapper: Fix strip algo when strip ranges overlap
GregF [Thu, 2 Nov 2017 20:01:57 +0000 (14:01 -0600)]
Remapper: Fix strip algo when strip ranges overlap

6 years agoFix #1079: don't give error when macro() name used without open (.
John Kessenich [Thu, 2 Nov 2017 12:48:32 +0000 (06:48 -0600)]
Fix #1079: don't give error when macro() name used without open (.

6 years agoFix nondeterminism discussed in 258b700f5957fc13b0512b3734a1b0e81a1c271d
John Kessenich [Thu, 2 Nov 2017 06:05:53 +0000 (00:05 -0600)]
Fix nondeterminism discussed in 258b700f5957fc13b0512b3734a1b0e81a1c271d

6 years agoFix #1065: don't validate Vulkan binding numbers.
John Kessenich [Thu, 2 Nov 2017 04:33:45 +0000 (22:33 -0600)]
Fix #1065: don't validate Vulkan binding numbers.

To handle sparse assignments, don't check maxCombinedTextureImageUnits.

6 years agoNon-functional: copyright update, to help with non-determinism test.
John Kessenich [Sat, 28 Oct 2017 20:42:44 +0000 (14:42 -0600)]
Non-functional: copyright update, to help with non-determinism test.

6 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.

6 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

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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

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

6 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.

6 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.

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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).

6 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().

6 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.

6 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.

6 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.

6 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.

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

6 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.

6 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.

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

6 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...

6 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.

6 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.

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

6 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.

6 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.

6 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

6 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

6 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

6 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

6 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.

6 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

6 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

6 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.

6 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.

6 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.

6 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

6 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.

6 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.

6 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

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

6 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

6 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

6 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.