platform/upstream/glslang.git
7 years agoHLSL: Fix merge conflict.
John Kessenich [Thu, 29 Sep 2016 16:27:57 +0000 (10:27 -0600)]
HLSL: Fix merge conflict.

7 years agoHLSL Tests: Tests for previous commit, to make it easier to see what's changing.
John Kessenich [Wed, 28 Sep 2016 05:09:32 +0000 (23:09 -0600)]
HLSL Tests: Tests for previous commit, to make it easier to see what's changing.

7 years agoSupport a uniform block to hold global uniform variables.
John Kessenich [Wed, 28 Sep 2016 01:13:05 +0000 (19:13 -0600)]
Support a uniform block to hold global uniform variables.

Used initially just by HLSL, for $Global.  Could be an option
for GLSL -> Vulkan.

7 years agoHLSL: Rationalize combination of type arrayness and name arrayness.
John Kessenich [Tue, 27 Sep 2016 20:38:57 +0000 (14:38 -0600)]
HLSL: Rationalize combination of type arrayness and name arrayness.

7 years agoMerge pull request #525 from steve-lunarg/implicit-size
John Kessenich [Wed, 28 Sep 2016 05:15:22 +0000 (23:15 -0600)]
Merge pull request #525 from steve-lunarg/implicit-size

HLSL: allow implicit size in array declarations

7 years agoHLSL: allow implicit array sizing.
steve-lunarg [Tue, 27 Sep 2016 16:57:35 +0000 (10:57 -0600)]
HLSL: allow implicit array sizing.

In HLSL array sizes need not be provided explicitly in all circumstances.
For example, this is valid (note no number between the [ ]):

  // no explicit array size
  uniform float g_array[] = { 1, 2, 3, 4, 5 };

This PR does not attempt to validate most invalid cases.

A new test is added to verify the resulting linker objects.

7 years agoMerge pull request #524 from DominikWitczakAMD/517_include_amd_extensions_by_default
John Kessenich [Tue, 27 Sep 2016 15:48:38 +0000 (09:48 -0600)]
Merge pull request #524 from DominikWitczakAMD/517_include_amd_extensions_by_default

#517: Enable AMD extensions by default

7 years ago#517: Enable AMD extensions by default
Dominik Witczak [Tue, 27 Sep 2016 07:51:34 +0000 (09:51 +0200)]
#517: Enable AMD extensions by default

7 years agoMerge pull request #520 from amdrexu/bugfix
John Kessenich [Mon, 26 Sep 2016 23:45:25 +0000 (17:45 -0600)]
Merge pull request #520 from amdrexu/bugfix

SPV: OpGroupBroadcast is unable to handle vector operand.

7 years agoMerge pull request #522 from steve-lunarg/glsl-binding-test
John Kessenich [Mon, 26 Sep 2016 23:40:17 +0000 (17:40 -0600)]
Merge pull request #522 from steve-lunarg/glsl-binding-test

GLSL: Add IO map tests

7 years agoGLSL: Add binding map tests
steve-lunarg [Mon, 26 Sep 2016 23:02:44 +0000 (17:02 -0600)]
GLSL: Add binding map tests

This PR adds a GLSL equivalent to the HLSL binding mapping tests for offsets and auto-numbering.
The shaders are as equivalent as possible.  The bindings of the base results match exactly
between the two.

7 years agoSPV: OpGroupBroadcast is unable to handle vector operand.
Rex Xu [Mon, 26 Sep 2016 07:53:40 +0000 (15:53 +0800)]
SPV: OpGroupBroadcast is unable to handle vector operand.

7 years agoHLSL: Reverse what the driver is told about row/column majorness, matching the row...
John Kessenich [Mon, 26 Sep 2016 02:25:06 +0000 (20:25 -0600)]
HLSL: Reverse what the driver is told about row/column majorness, matching the row-column reversal.

7 years agoMerge pull request #519 from amdrexu/bugfix
John Kessenich [Fri, 23 Sep 2016 23:31:31 +0000 (17:31 -0600)]
Merge pull request #519 from amdrexu/bugfix

SPV: Still have to specify SPIR-V extension for gl_SubGroupSizeARB and gl_SubGroupInvocationARB.

7 years agoSPV: Still have to specify SPIR-V extension for gl_SubGroupSizeARB and gl_SubGroupInv...
Rex Xu [Fri, 23 Sep 2016 14:13:43 +0000 (22:13 +0800)]
SPV: Still have to specify SPIR-V extension for gl_SubGroupSizeARB and gl_SubGroupInvocationARB.

7 years agoMerge pull request #518 from steve-lunarg/flatten-fix
John Kessenich [Fri, 23 Sep 2016 03:52:44 +0000 (21:52 -0600)]
Merge pull request #518 from steve-lunarg/flatten-fix

Fix defects in uniform array flattening

7 years agoFix defects in uniform array flattening
steve-lunarg [Thu, 22 Sep 2016 20:35:23 +0000 (14:35 -0600)]
Fix defects in uniform array flattening

Fix for two defects as follows:

- The IO mapping traverser was not setting inVisit, and would skip some AST nodes.
  Depending on the order of nodes, this could have prevented the binding from
  showing up in the generated SPIR-V.

- If a uniform array was flattened, each of the flattened scalars from the array
  is still a (now-scalar) uniform.  It was being converted to a temporary.

7 years agoMerge pull request #516 from amdrexu/feature3
John Kessenich [Thu, 22 Sep 2016 16:54:18 +0000 (10:54 -0600)]
Merge pull request #516 from amdrexu/feature3

SPV: Implement the extension SPV_KHR_shader_ballot

7 years agoHLSL: Merge pull request #515 from steve-lunarg/flatten-uniform-array
John Kessenich [Thu, 22 Sep 2016 16:01:37 +0000 (10:01 -0600)]
HLSL: Merge pull request #515 from steve-lunarg/flatten-uniform-array

HLSL: Flatten uniform arrays

7 years agoFlatten uniform arrays
steve-lunarg [Fri, 16 Sep 2016 19:26:37 +0000 (13:26 -0600)]
Flatten uniform arrays

This checkin adds a --flatten-uniform-arrays option which can break
uniform arrays of samplers, textures, or UBOs up into individual
scalars named (e.g) myarray[0], myarray[1], etc.  These appear as
individual linkage objects.

Code notes:

- shouldFlatten internally calls shouldFlattenIO, and shouldFlattenUniform,
  but is the only flattening query directly called.

- flattenVariable will handle structs or arrays (but not yet arrayed structs;
  this is tested an an error is generated).

- There's some error checking around unhandled situations.  E.g, flattening
  uniform arrays with initializer lists is not implemented.

- This piggybacks on as much of the existing mechanism for struct flattening
  as it can.  E.g, it uses the same flattenMap, and the same
  flattenAccess() method.

- handleAssign() has been generalized to cope with either structs or arrays.

- Extended test infrastructure to test flattening ability.

7 years agoSPV: Implement the extension SPV_KHR_shader_ballot
Rex Xu [Wed, 21 Sep 2016 10:56:12 +0000 (18:56 +0800)]
SPV: Implement the extension SPV_KHR_shader_ballot

7 years agoHLSL: Fix result type of passing a flattened-aggregate to a function.
John Kessenich [Wed, 21 Sep 2016 23:50:12 +0000 (17:50 -0600)]
HLSL: Fix result type of passing a flattened-aggregate to a function.

7 years agoMerge pull request #514 from steve-lunarg/binding-map-3
John Kessenich [Wed, 21 Sep 2016 14:57:31 +0000 (08:57 -0600)]
Merge pull request #514 from steve-lunarg/binding-map-3

HLSL: Add location offsets per resource type

7 years agoHLSL: Add location offsets per resource type
steve-lunarg [Wed, 7 Sep 2016 21:20:19 +0000 (15:20 -0600)]
HLSL: Add location offsets per resource type

This PR adds the ability to offset sampler, texture, and UBO bindings
from provided base bindings, and to auto-number bindings that are not
provided with explicit register numbers. The mechanism works as
follows:

- Offsets may be given on the command line for all stages, or
  individually for one or more single stages, in which case the
  offset will be auto-selected according to the stage being
  compiled. There is also an API to set them. The new command line
  options are --shift-sampler-binding, --shift-texture-binding, and
  --shift-UBO-binding.

- Uniforms which are not given explicit bindings in the source code
  are auto-numbered if and only if they are in live code as
  determined by the algorithm used to build the reflection
  database, and the --auto-map-bindings option is given. This auto-numbering
  avoids using any binding slots which were explicitly provided in
  the code, whether or not that explicit use was live. E.g, "uniform
  Texture1D foo : register(t3);" with --shift-texture-binding 10 will
  reserve binding 13, whether or not foo is used in live code.

- Shorter synonyms for the command line options are available.  See
  the --help output.

The testing infrastructure is slightly extended to allow use of the
binding offset API, and two new tests spv.register.(no)autoassign.frag are
added for comparing the resulting SPIR-V.

7 years agoHLSL: Move to correct parsing of annotations, improving all annotations and recent...
John Kessenich [Tue, 20 Sep 2016 19:22:58 +0000 (13:22 -0600)]
HLSL: Move to correct parsing of annotations, improving all annotations and recent string grammar.

7 years agoHLSL: Turn on reflection, with basic test file, to catch regressions.
John Kessenich [Tue, 20 Sep 2016 05:12:48 +0000 (23:12 -0600)]
HLSL: Turn on reflection, with basic test file, to catch regressions.

This is not a claim that reflection is working right, only a way to
see it is occurring and catch any regression.

7 years agoHLSL: Remove extraneous built-in member decorations for IO structs used in non-IO...
John Kessenich [Tue, 20 Sep 2016 04:16:09 +0000 (22:16 -0600)]
HLSL: Remove extraneous built-in member decorations for IO structs used in non-IO situations.

7 years agoHLSL: Add string basic type and recognize string declaration grammar.
John Kessenich [Tue, 20 Sep 2016 02:23:18 +0000 (20:23 -0600)]
HLSL: Add string basic type and recognize string declaration grammar.

This includes the "< decl ; decl ; >" syntax which has its own namespace.
This functionality is not implemented, just silently accepted.

7 years agoTrack separate entry-point names and mangled names...
John Kessenich [Tue, 20 Sep 2016 00:09:30 +0000 (18:09 -0600)]
Track separate entry-point names and mangled names...

... and use each in the correct way at consumption sites.
This completes issue #513.

7 years agoMerge pull request #512 from steve-lunarg/liveness-traverser
John Kessenich [Mon, 19 Sep 2016 23:19:25 +0000 (17:19 -0600)]
Merge pull request #512 from steve-lunarg/liveness-traverser

Refactor TLiveTraverser from the former reflection traverser, for fut…

7 years agoRefactor TLiveTraverser from the former reflection traverser, for future use in bindi...
steve-lunarg [Mon, 19 Sep 2016 21:35:12 +0000 (15:35 -0600)]
Refactor TLiveTraverser from the former reflection traverser, for future use in binding mapping.

This PR factors out the code that knows how to walk just the live parts of the AST.
The traverser in reflect.cpp is renamed to TReflectionTraverser, and inherits from
TLiveTraverser, which will also be used by a future binding offset PR.

The code is now smart about the entry point name (no longer hardcoded to "main").

There is an option to traverse all code (live+dead), because a consumer of the
class may wish to use it for both purposes without wanting a whole separate
class hierarchy.

7 years agoNon-functional: Sweep through the stack for consistent with "main" and entry point.
John Kessenich [Mon, 19 Sep 2016 22:01:41 +0000 (16:01 -0600)]
Non-functional: Sweep through the stack for consistent with "main" and entry point.

Partially addresses issue #513.

7 years agoHLSL: Change the final syntax-error printf to go to the infoLog.
John Kessenich [Mon, 19 Sep 2016 20:56:55 +0000 (14:56 -0600)]
HLSL: Change the final syntax-error printf to go to the infoLog.

Fixes issue #510.

7 years agoHLSL: Fix assert: ensure flattened shadow is EvqTemporary.
John Kessenich [Mon, 19 Sep 2016 06:19:49 +0000 (00:19 -0600)]
HLSL: Fix assert: ensure flattened shadow is EvqTemporary.

7 years agoHLSL: Intercept flatten aggregates passed to a function input, and copy member-by...
John Kessenich [Mon, 19 Sep 2016 06:06:19 +0000 (00:06 -0600)]
HLSL: Intercept flatten aggregates passed to a function input, and copy member-by-member.

7 years agoHLSL: Non-functional; make flatten semantics be about aggregates, not just structures.
John Kessenich [Mon, 19 Sep 2016 05:10:22 +0000 (23:10 -0600)]
HLSL: Non-functional; make flatten semantics be about aggregates, not just structures.

7 years agoHLSL: Fix bug in previous checkin when non-flattened objects are not simple l-values.
John Kessenich [Sat, 17 Sep 2016 03:16:04 +0000 (21:16 -0600)]
HLSL: Fix bug in previous checkin when non-flattened objects are not simple l-values.

7 years agoHLSL: Handle flatten for reads from flatten structs and parameter passing.
John Kessenich [Sat, 17 Sep 2016 01:44:00 +0000 (19:44 -0600)]
HLSL: Handle flatten for reads from flatten structs and parameter passing.

7 years agoHLSL: Improve setting and testing of interpolation qualifiers.
John Kessenich [Fri, 16 Sep 2016 23:10:39 +0000 (17:10 -0600)]
HLSL: Improve setting and testing of interpolation qualifiers.

Notably, use of 'linear' on a non-input could mark it as an input.

7 years agoHLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs.
John Kessenich [Fri, 16 Sep 2016 09:05:12 +0000 (03:05 -0600)]
HLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs.

7 years agoHLSL: Flatten all input/output structs, regardless of stage.
John Kessenich [Fri, 16 Sep 2016 07:52:14 +0000 (01:52 -0600)]
HLSL: Flatten all input/output structs, regardless of stage.

This is needed because an output structure can contain embedded built-ins
(like SV_Position) which should not get locations assigned.

7 years agoHLSL: Flatten a return struct from an entry point and assign locations after flattening.
John Kessenich [Fri, 16 Sep 2016 07:44:43 +0000 (01:44 -0600)]
HLSL: Flatten a return struct from an entry point and assign locations after flattening.

Locations now get assigned in order, but skipping built-ins, which can be
done post flattening.

7 years agoHLSL: return correct error when HLSL parsing fails.
John Kessenich [Fri, 16 Sep 2016 04:49:31 +0000 (22:49 -0600)]
HLSL: return correct error when HLSL parsing fails.

At least partially addresses issue #510.

7 years agoMerge pull request #508 from amdrexu/bugfix
John Kessenich [Fri, 16 Sep 2016 04:41:37 +0000 (22:41 -0600)]
Merge pull request #508 from amdrexu/bugfix

SPV: Support simultaneous l-value swizzle and dynamic component selection.

7 years agoSPV: Support simultaneous l-value swizzle and dynamic component selection.
Rex Xu [Wed, 14 Sep 2016 06:43:21 +0000 (14:43 +0800)]
SPV: Support simultaneous l-value swizzle and dynamic component selection.

7 years agoHLSL: Register all entry-point in/out as part of the interface.
John Kessenich [Mon, 12 Sep 2016 17:55:47 +0000 (11:55 -0600)]
HLSL: Register all entry-point in/out as part of the interface.

This makes the interface be invariant, whether or not individual
variables are used.

7 years agoSPV: Fix issue #506: generalize struct deep copy to include arrays.
John Kessenich [Sun, 11 Sep 2016 18:33:43 +0000 (12:33 -0600)]
SPV: Fix issue #506: generalize struct deep copy to include arrays.

7 years agoHLSL: Flatten vertex input and fragment output structures.
John Kessenich [Fri, 9 Sep 2016 22:32:09 +0000 (16:32 -0600)]
HLSL: Flatten vertex input and fragment output structures.

Vulkan can't handle structures into the vertex stage or out
of the fragment stage.

7 years agoMerge pull request #505 from steve-lunarg/rowmajor-fix-2a
John Kessenich [Fri, 9 Sep 2016 20:00:27 +0000 (14:00 -0600)]
Merge pull request #505 from steve-lunarg/rowmajor-fix-2a

HLSL: alias HLSL matrix-row-column onto AST matrix-column-row

7 years agoWIP: HLSL: Treat HLSL rows as GLSL columns.
steve-lunarg [Wed, 24 Aug 2016 20:36:13 +0000 (14:36 -0600)]
WIP: HLSL: Treat HLSL rows as GLSL columns.

WIP: HLSL: EOpGenMul arg reversal

7 years agoHLSL: Report an error if SPIR-V for Vulkan wasn't selected.
John Kessenich [Fri, 9 Sep 2016 17:43:11 +0000 (11:43 -0600)]
HLSL: Report an error if SPIR-V for Vulkan wasn't selected.

7 years agoMerge branch 'amdrexu-bugfix2'
John Kessenich [Fri, 9 Sep 2016 16:46:43 +0000 (10:46 -0600)]
Merge branch 'amdrexu-bugfix2'

7 years agoMerge branch 'bugfix2' of https://github.com/amdrexu/glslang into amdrexu-bugfix2
John Kessenich [Fri, 9 Sep 2016 16:46:10 +0000 (10:46 -0600)]
Merge branch 'bugfix2' of https://github.com/amdrexu/glslang into amdrexu-bugfix2

7 years agoMerge pull request #503 from amdrexu/feature3
John Kessenich [Fri, 9 Sep 2016 16:41:16 +0000 (10:41 -0600)]
Merge pull request #503 from amdrexu/feature3

SPV: Use OpBitcast to implement 4 pack/unpack built-in functions.

7 years agoSPV: Use OpBitcast to implement 4 pack/unpack built-in functions.
Rex Xu [Fri, 9 Sep 2016 09:50:07 +0000 (17:50 +0800)]
SPV: Use OpBitcast to implement 4 pack/unpack built-in functions.

7 years agoPreprocessor: UINT_MAX is translated to constant incorrectly.
Rex Xu [Tue, 6 Sep 2016 05:46:12 +0000 (13:46 +0800)]
Preprocessor: UINT_MAX is translated to constant incorrectly.

7 years agoHLSL: Support register(..., spaceN) for setting the descriptor set.
John Kessenich [Mon, 5 Sep 2016 22:03:12 +0000 (16:03 -0600)]
HLSL: Support register(..., spaceN) for setting the descriptor set.

This was suggested in issue #454.

7 years agoHLSL: Accept layout(...) also as a post-decl. Issue #454.
John Kessenich [Mon, 5 Sep 2016 20:37:03 +0000 (14:37 -0600)]
HLSL: Accept layout(...) also as a post-decl.  Issue #454.

7 years agoHLSL Non-Functional: Move to more robust capturing of postDecls into a qualifier.
John Kessenich [Mon, 5 Sep 2016 18:40:06 +0000 (12:40 -0600)]
HLSL Non-Functional: Move to more robust capturing of postDecls into a qualifier.

This will prevent a possible future defect of thinking the type can be changed,
where there is a code path today that would drop that change.

7 years agoHLSL: Track binding numbers to struct instances; fixes issue #496.
John Kessenich [Mon, 5 Sep 2016 18:19:18 +0000 (12:19 -0600)]
HLSL: Track binding numbers to struct instances; fixes issue #496.

7 years agoMerge pull request #498 from amdrexu/bugfix
John Kessenich [Mon, 5 Sep 2016 17:35:34 +0000 (11:35 -0600)]
Merge pull request #498 from amdrexu/bugfix

Parser: Add 64-bit type conversion for specialization constant.

7 years agoParser: Add 64-bit type conversion for specialization constant.
Rex Xu [Mon, 5 Sep 2016 08:10:14 +0000 (16:10 +0800)]
Parser: Add 64-bit type conversion for specialization constant.

7 years agoHLSL: Handle swizzles on vectors of size 1. Addresses issue #453.
John Kessenich [Sat, 3 Sep 2016 04:21:25 +0000 (22:21 -0600)]
HLSL: Handle swizzles on vectors of size 1. Addresses issue #453.

7 years agoHLSL: Fix issue #442, smear and truncate shape conversions for == and !=.
John Kessenich [Sat, 3 Sep 2016 03:12:23 +0000 (21:12 -0600)]
HLSL: Fix issue #442, smear and truncate shape conversions for == and !=.

7 years agoHLSL: Handle "fake" entry points, by undoing their built-in variable declarations.
John Kessenich [Sat, 3 Sep 2016 02:23:27 +0000 (20:23 -0600)]
HLSL: Handle "fake" entry points, by undoing their built-in variable declarations.

7 years agoHLSL: Handle greater/less depth modes. Fixes issue #489.
John Kessenich [Sat, 3 Sep 2016 02:05:19 +0000 (20:05 -0600)]
HLSL: Handle greater/less depth modes. Fixes issue #489.

7 years agoHLSL: Error if funcion with return type doesn't return a value.
John Kessenich [Sat, 3 Sep 2016 01:13:36 +0000 (19:13 -0600)]
HLSL: Error if funcion with return type doesn't return a value.

7 years agoHLSL: Correct line numbers for function definitions.
John Kessenich [Sat, 3 Sep 2016 01:05:24 +0000 (19:05 -0600)]
HLSL: Correct line numbers for function definitions.

7 years agoSPV: Flatten structs for copy when they are GLSL type aliases.
John Kessenich [Fri, 2 Sep 2016 17:20:21 +0000 (11:20 -0600)]
SPV: Flatten structs for copy when they are GLSL type aliases.

Addresses issue #304 and issue #307 by replacing unmatched type OpStores with
per-member copies. Covers assignment statements and most argument passing, but
does not yet cover r-value-based argument passing.

7 years agoMerge pull request #495 from steve-lunarg/remapper-tests-2
John Kessenich [Fri, 2 Sep 2016 16:57:24 +0000 (10:57 -0600)]
Merge pull request #495 from steve-lunarg/remapper-tests-2

Remapper: move remapper tests into the glslangtests executable.

7 years agoRemapper: move remapper tests into the glslangtests executable.
steve-lunarg [Fri, 2 Sep 2016 15:21:12 +0000 (09:21 -0600)]
Remapper: move remapper tests into the glslangtests executable.

7 years agoSPV: Tighten up number of struct-types declared based on decoration.
John Kessenich [Thu, 1 Sep 2016 23:05:23 +0000 (17:05 -0600)]
SPV: Tighten up number of struct-types declared based on decoration.

Takes some pressure off of issue #304.
Structures don't inherit locations and then explicitly decorate
members with them, so removed this reason to have another instance
of a structure type.

7 years agoFront-ends: Remove now defunct afterEOF and related, use scanner's instead.
John Kessenich [Wed, 31 Aug 2016 19:43:51 +0000 (13:43 -0600)]
Front-ends: Remove now defunct afterEOF and related, use scanner's instead.

Code using atEndOfFile was dead, instead do something useful with
the scanners atEndOfInput().  This allows a better error message
for early termination of cascading errors.

7 years agoHLSL: Start location numbering with the entry-point return value.
John Kessenich [Tue, 30 Aug 2016 00:10:47 +0000 (18:10 -0600)]
HLSL: Start location numbering with the entry-point return value.

Also, increment location numbers by the size of the objects.

7 years agoHLSL: Remove recent change to put locations on SV_TARGET*.
John Kessenich [Mon, 29 Aug 2016 22:49:39 +0000 (16:49 -0600)]
HLSL: Remove recent change to put locations on SV_TARGET*.

This put locations on members of structures, which is not allowed
in either AST or SPIR-V.

This was caught by asserts in the debug build.

7 years agoHLSL: Create test results for the previous commits.
John Kessenich [Mon, 29 Aug 2016 22:34:12 +0000 (16:34 -0600)]
HLSL: Create test results for the previous commits.

7 years agoMerge branch 'dankbaker-HLSL_Semantic_Mapping'
John Kessenich [Mon, 29 Aug 2016 22:08:22 +0000 (16:08 -0600)]
Merge branch 'dankbaker-HLSL_Semantic_Mapping'

7 years agoMerge branch 'HLSL_Semantic_Mapping' of https://github.com/dankbaker/glslang into...
John Kessenich [Mon, 29 Aug 2016 22:07:29 +0000 (16:07 -0600)]
Merge branch 'HLSL_Semantic_Mapping' of https://github.com/dankbaker/glslang into dankbaker-HLSL_Semantic_Mapping

7 years agoMerge pull request #490 from KhronosGroup/hlsl-output-return
John Kessenich [Mon, 29 Aug 2016 21:43:21 +0000 (15:43 -0600)]
Merge pull request #490 from KhronosGroup/hlsl-output-return

HLSL: Emulate write-to-output on return-from-entry-point, for return …

7 years agoHLSL: Setting SV_DEPTHGREATEREQUAL and SV_DEPTHLESSEQUAL to EbvFragDepth for now
Dan Baker [Mon, 29 Aug 2016 19:56:55 +0000 (15:56 -0400)]
HLSL: Setting SV_DEPTHGREATEREQUAL and SV_DEPTHLESSEQUAL to EbvFragDepth for now

7 years agoMerge branch 'hlsl-output-return' of github.com:KhronosGroup/glslang into hlsl-output...
John Kessenich [Mon, 29 Aug 2016 02:13:36 +0000 (20:13 -0600)]
Merge branch 'hlsl-output-return' of github.com:KhronosGroup/glslang into hlsl-output-return

7 years agoHLSL: Emulate write-to-output on return-from-entry-point, for return value.
John Kessenich [Sun, 28 Aug 2016 21:00:23 +0000 (15:00 -0600)]
HLSL: Emulate write-to-output on return-from-entry-point, for return value.

This fixes issue #487 and #480.
It also correctly handles output parameters from the entry point.

7 years agoHLSL: Emulate write-to-output on return-from-entry-point, for return value.
John Kessenich [Sun, 28 Aug 2016 21:00:23 +0000 (15:00 -0600)]
HLSL: Emulate write-to-output on return-from-entry-point, for return value.

This fixes issue #487 and #480.
It also correctly handles output parameters from the entry point.

7 years agoNon-functional: Add some missing const, related to signature selection. upstream/0.1
John Kessenich [Fri, 26 Aug 2016 20:01:43 +0000 (14:01 -0600)]
Non-functional: Add some missing const, related to signature selection.

7 years agoMerge pull request #488 from antiagainst/c4996-warning
John Kessenich [Fri, 26 Aug 2016 19:16:30 +0000 (13:16 -0600)]
Merge pull request #488 from antiagainst/c4996-warning

Disable C4996 (secure CRT) recommendation on Windows for strtok().

7 years agoDisable C4996 (secure CRT) recommendation on Windows for strtok().
Lei Zhang [Fri, 26 Aug 2016 18:43:14 +0000 (14:43 -0400)]
Disable C4996 (secure CRT) recommendation on Windows for strtok().

strtok_s() is suggested by MSVC, but it has different signature
than the C11 standard one. So we just turn off the recommendation
here.

7 years agoMerge pull request #473 from steve-lunarg/remapper-tests
John Kessenich [Fri, 26 Aug 2016 17:32:54 +0000 (11:32 -0600)]
Merge pull request #473 from steve-lunarg/remapper-tests

SPV Remapper: add remapper test framework

7 years agoHLSL: Include shape-changing conversions in overloaded signature selection.
John Kessenich [Thu, 25 Aug 2016 21:57:56 +0000 (15:57 -0600)]
HLSL: Include shape-changing conversions in overloaded signature selection.

This also enables vecN -> vec1 shape conversions for all places doing shape
conversions.

For signature selection, makes shape changes worse than any other comparison
when deciding what conversions are better than others.

7 years agoHLSL: Format updates and some minor adjustments to SV_ handling
Dan Baker [Thu, 25 Aug 2016 21:13:25 +0000 (17:13 -0400)]
HLSL: Format updates and some minor adjustments to SV_ handling

7 years agoHLSL: Allow arbitrary baseType -> baseType conversion of calling arguments.
John Kessenich [Thu, 25 Aug 2016 16:49:21 +0000 (10:49 -0600)]
HLSL: Allow arbitrary baseType -> baseType conversion of calling arguments.

This also puts a stake in the ground as to which is better when selection
from multiple signatures.

7 years agoWIP: SPV Remapper: add remapper test framework
steve-lunarg [Wed, 17 Aug 2016 22:18:06 +0000 (16:18 -0600)]
WIP: SPV Remapper: add remapper test framework

7 years agoFirst stab at system value interpretation
Dan Baker [Thu, 25 Aug 2016 15:59:17 +0000 (11:59 -0400)]
First stab at system value interpretation

7 years agoMerge pull request #483 from steve-lunarg/precise-fix-2
John Kessenich [Thu, 25 Aug 2016 15:32:19 +0000 (09:32 -0600)]
Merge pull request #483 from steve-lunarg/precise-fix-2

HLSL: add precise keyword

7 years agoHLSL: add precise keyword
steve-lunarg [Thu, 25 Aug 2016 05:49:36 +0000 (23:49 -0600)]
HLSL: add precise keyword

7 years agoHLSL: Switch to generic selector, but using GLSL #version 400 rules.
John Kessenich [Thu, 25 Aug 2016 00:34:43 +0000 (18:34 -0600)]
HLSL: Switch to generic selector, but using GLSL #version 400 rules.

Next step is to modify for HLSL rules.

7 years agoMerge branch 'overloaded-400' of github.com:KhronosGroup/glslang
John Kessenich [Wed, 24 Aug 2016 00:20:19 +0000 (18:20 -0600)]
Merge branch 'overloaded-400' of github.com:KhronosGroup/glslang

7 years agoFront-end: Warn for likely missed change in default precisions.
John Kessenich [Wed, 3 Aug 2016 23:35:19 +0000 (17:35 -0600)]
Front-end: Warn for likely missed change in default precisions.

This is part of the change to have desktop shaders respect precision
qualifiers on Vulkan, but since the defaults are all highp, and that's
different from ES fragment shaders, detect likely cases and warn about
them (but being careful to not be too noisy if it's unlikely to be a
problem).

7 years agoVulkan: Have desktop shaders respect precision qualifiers.
John Kessenich [Wed, 3 Aug 2016 22:41:53 +0000 (16:41 -0600)]
Vulkan: Have desktop shaders respect precision qualifiers.

Sets highp defaults for the appropriate types, for all stages,
and turns on precision qualifiers for non-ES shaders.  Required
fixing some qualifier orders for desktop built-in declarations
for pre-420 shaders.

7 years agoFront-End: Non-ES trigger for processing precision qualifiers.
John Kessenich [Wed, 3 Aug 2016 21:19:37 +0000 (15:19 -0600)]
Front-End: Non-ES trigger for processing precision qualifiers.

Initially non-functional: Have an independent test for whether to obey
precision qualifiers other than whether the profile is es.

7 years agoNon-functional: Fix commit 98f164ec488f85af5a44b701477a34e810f2deb1.
John Kessenich [Tue, 23 Aug 2016 23:51:13 +0000 (17:51 -0600)]
Non-functional: Fix commit 98f164ec488f85af5a44b701477a34e810f2deb1.

Fix previous commit to not use tabs and otherwise match local coding
conventions better.