platform/upstream/glslang.git
7 years agoMerge pull request #565 from mre4ce/master
John Kessenich [Tue, 25 Oct 2016 06:16:12 +0000 (00:16 -0600)]
Merge pull request #565 from mre4ce/master

Disabled MSVC 2015 compile warnings.

7 years agoupdate
Johannes van Waveren [Fri, 21 Oct 2016 08:30:50 +0000 (17:30 +0900)]
update

7 years agoMerge remote-tracking branch 'upstream/master'
Johannes van Waveren [Fri, 21 Oct 2016 08:21:46 +0000 (17:21 +0900)]
Merge remote-tracking branch 'upstream/master'

7 years agofixed MSVC 2015 compile warnings
Johannes van Waveren [Fri, 21 Oct 2016 08:21:12 +0000 (17:21 +0900)]
fixed MSVC 2015 compile warnings

7 years agoMerge pull request #559 from steve-lunarg/samplecmp-fix
John Kessenich [Fri, 21 Oct 2016 01:22:57 +0000 (19:22 -0600)]
Merge pull request #559 from steve-lunarg/samplecmp-fix

HLSL: fix defect in EOpMethodSampleCmp* texture decomposition

7 years agoMerge pull request #558 from steve-lunarg/image-atomics
John Kessenich [Fri, 21 Oct 2016 01:09:55 +0000 (19:09 -0600)]
Merge pull request #558 from steve-lunarg/image-atomics

HLSL: phase 4 of RWTexture support: add image atomics

7 years agoMerge pull request #555 from steve-lunarg/promotion-fixes
John Kessenich [Fri, 21 Oct 2016 01:07:27 +0000 (19:07 -0600)]
Merge pull request #555 from steve-lunarg/promotion-fixes

HLSL: Fix unary and binary operator type conversion issues

7 years agoMerge pull request #556 from dneto0/guard-amd-enums
John Kessenich [Fri, 21 Oct 2016 01:04:30 +0000 (19:04 -0600)]
Merge pull request #556 from dneto0/guard-amd-enums

SPV: Add missing guard to code that uses AMD extensions

7 years agoHLSL: fix defect in EOpMethodSampleCmp* texture decomposition
steve-lunarg [Thu, 20 Oct 2016 20:50:12 +0000 (14:50 -0600)]
HLSL: fix defect in EOpMethodSampleCmp* texture decomposition

HLSL holds the compare value in a separate intrinsic arg, but the AST wants
a vector including the cmp val, except in the 4-dim coord case, where it
doesn't fit and is in fact a separate AST parameter.  This is awkward but
necessary, given AST semantics.  In the process, a new vector is constructed
for the combined result, but this vector was not being given the correct
TType, so was causing some downstream troubles.

Now it is.  A similar defect existed in OpTextureBias, and has also been
fixed.

7 years agoMove promote methods to TIntermediate class
steve-lunarg [Wed, 19 Oct 2016 18:57:22 +0000 (12:57 -0600)]
Move promote methods to TIntermediate class

A need arose to use capabilities from TIntermediate during
node promotion.  These methods have been moved from virtual
methods on the TIntermUnary and TIntermBinary nodes to methods
on TIntermediate, so it is easy for them construct new nodes
and so on.

This is done as a separate commit to verify that no test results
are changed as a result.

7 years agoHLSL: phase 4 of rwtexture support: add image atomics
steve-lunarg [Wed, 19 Oct 2016 16:15:25 +0000 (10:15 -0600)]
HLSL: phase 4 of rwtexture support: add image atomics

This PR will turn Interlocked* intrinsics using rwtexture or rwbuffer
object as the first parameter into the proper OpImageAtomic* operations.

7 years agoAdd missing guard to code that uses AMD extensions
David Neto [Wed, 19 Oct 2016 14:16:29 +0000 (10:16 -0400)]
Add missing guard to code that uses AMD extensions

Otherwise compilation fails when ENABLED_AMD_EXTENSIONS is off.

7 years agoHLSL: Fix unary and binary operator type conversion issues
steve-lunarg [Sat, 15 Oct 2016 16:29:58 +0000 (10:29 -0600)]
HLSL: Fix unary and binary operator type conversion issues

This fixes defects as follows:

1. handleLvalue could be called on a non-L-value, and it shouldn't be.

2. HLSL allows unary negation on non-bool values.  TUnaryOperator::promote
   can now promote other types (e.g, int, float) to bool for this op.

3. HLSL allows binary logical operations (&&, ||) on arbitrary types, similar
   (2).

4. HLSL allows mod operation on arbitrary types, which will be promoted.
   E.g, int % float -> float % float.

7 years agoHLSL: Turn on tests for groupshared.
John Kessenich [Sun, 16 Oct 2016 18:22:20 +0000 (12:22 -0600)]
HLSL: Turn on tests for groupshared.

7 years agoHLSL: Support SV_Coverage and SV_DispatchThreadId; catch SV_GroupIndex.
John Kessenich [Sun, 16 Oct 2016 18:12:11 +0000 (12:12 -0600)]
HLSL: Support SV_Coverage and SV_DispatchThreadId; catch SV_GroupIndex.

7 years agoBuild: Fix unsigned/signed warning.
John Kessenich [Sun, 16 Oct 2016 17:50:46 +0000 (11:50 -0600)]
Build: Fix unsigned/signed warning.

7 years agoMerge pull request #548 from baldurk/vs2010-compile-fixes
John Kessenich [Sun, 16 Oct 2016 05:09:31 +0000 (23:09 -0600)]
Merge pull request #548 from baldurk/vs2010-compile-fixes

VS2010 compile fixes

7 years agoMerge pull request #551 from steve-lunarg/rwbuffers-fmt
John Kessenich [Sun, 16 Oct 2016 05:03:38 +0000 (23:03 -0600)]
Merge pull request #551 from steve-lunarg/rwbuffers-fmt

HLSL: phase 3 of rwtexture support: add sub-vec4 capabilities

7 years agoMerge pull request #539 from schwa423/linux_global_lock
John Kessenich [Sun, 16 Oct 2016 04:53:46 +0000 (22:53 -0600)]
Merge pull request #539 from schwa423/linux_global_lock

Use pthread_mutex for global lock on Linux.

7 years agoMerge pull request #550 from amdrexu/bugfix
John Kessenich [Sun, 16 Oct 2016 04:49:53 +0000 (22:49 -0600)]
Merge pull request #550 from amdrexu/bugfix

SPV: Add missing extension declarations for certain AMD extensions.

7 years agoMerge pull request #549 from steve-lunarg/multidim-array
John Kessenich [Sun, 16 Oct 2016 04:43:43 +0000 (22:43 -0600)]
Merge pull request #549 from steve-lunarg/multidim-array

HLSL: allow multi-dimensional arrays

7 years agoUse a recursive mutex.
Josh Gargus [Sat, 15 Oct 2016 22:19:59 +0000 (15:19 -0700)]
Use a recursive mutex.

7 years agoHLSL: phase 3c: add option to use Unknown storage format
steve-lunarg [Sat, 15 Oct 2016 00:36:42 +0000 (18:36 -0600)]
HLSL: phase 3c: add option to use Unknown storage format

This uses the Unknown storage format, instead of deducing the
format from the texture declaration type.

7 years agoHLSL: phase 3b: Texture methods remember and return vector size.
steve-lunarg [Fri, 14 Oct 2016 22:40:32 +0000 (16:40 -0600)]
HLSL: phase 3b: Texture methods remember and return vector size.

Also makes a (correct) test change for global -> temp vars.

7 years agoHLSL: phase 3a: Add sub-vec4 rwtexture formats (qualifier.layoutFormat)
steve-lunarg [Mon, 10 Oct 2016 21:24:57 +0000 (15:24 -0600)]
HLSL: phase 3a: Add sub-vec4 rwtexture formats (qualifier.layoutFormat)

This PR sets the TQualifier layoutFormat according to the HLSL image type.
For instance:

  RWTexture1D <float2> g_tTex1df2;

becomes ElfRg32f.  Similar on Buffers, e.g, Buffer<float4> mybuffer;

The return type for image and buffer loads is now taken from the storage format.
Also, the qualifier for the return type is now (properly) a temp, not a global.

7 years agoSPV: Add missing extension declarations for certain AMD extensions.
Rex Xu [Fri, 14 Oct 2016 09:41:45 +0000 (17:41 +0800)]
SPV: Add missing extension declarations for certain AMD extensions.

7 years agoMerge pull request #542 from steve-lunarg/rwbuffers
John Kessenich [Thu, 13 Oct 2016 18:49:56 +0000 (12:49 -0600)]
Merge pull request #542 from steve-lunarg/rwbuffers

HLSL: phase 2: add operator[]

7 years agoMerge pull request #538 from steve-lunarg/iomap-binding-range-err
John Kessenich [Thu, 13 Oct 2016 18:44:16 +0000 (12:44 -0600)]
Merge pull request #538 from steve-lunarg/iomap-binding-range-err

Check for out-of-range bindings during IO mapping.

7 years agoHLSL: allow multi-dimensional arrays
steve-lunarg [Thu, 13 Oct 2016 18:26:18 +0000 (12:26 -0600)]
HLSL: allow multi-dimensional arrays

All the underpinnings are there; this just parses multiple array dimensions
and passes them through to the existing mechanisms.

Also, minor comment fixes, and add a new test for multi-dim arrays.

7 years agoUpdate HexFloat tests to use non-enum class enum values
baldurk [Thu, 13 Oct 2016 18:05:13 +0000 (20:05 +0200)]
Update HexFloat tests to use non-enum class enum values

7 years agoChange negatable_left_shift and negatable_right_shift to inline funcs
baldurk [Thu, 13 Oct 2016 17:39:24 +0000 (19:39 +0200)]
Change negatable_left_shift and negatable_right_shift to inline funcs

* This avoids an internal compile error on VS2010 possibly related to
  std::enable_if use.

7 years agoChange {} constructor brackets to ()
baldurk [Thu, 13 Oct 2016 17:32:37 +0000 (19:32 +0200)]
Change {} constructor brackets to ()

7 years agoChange "using x = y;" to "typedef y x;" statements
baldurk [Thu, 13 Oct 2016 17:31:15 +0000 (19:31 +0200)]
Change "using x = y;" to "typedef y x;" statements

7 years agoExplicitly implement default constructors
baldurk [Thu, 13 Oct 2016 17:30:27 +0000 (19:30 +0200)]
Explicitly implement default constructors

7 years agoAdd std::isnan and std::isinf wrappers for VS2010 that doesn't have them
baldurk [Thu, 13 Oct 2016 17:28:54 +0000 (19:28 +0200)]
Add std::isnan and std::isinf wrappers for VS2010 that doesn't have them

7 years agoChange enum class to plain enum
baldurk [Thu, 13 Oct 2016 17:28:20 +0000 (19:28 +0200)]
Change enum class to plain enum

7 years agoChange constructor to use ()s instead of {}s
baldurk [Thu, 13 Oct 2016 17:25:52 +0000 (19:25 +0200)]
Change constructor to use ()s instead of {}s

7 years agoAdd #include <cstdint> for std::uint32_t usage
baldurk [Thu, 13 Oct 2016 17:24:42 +0000 (19:24 +0200)]
Add #include <cstdint> for std::uint32_t usage

7 years agoAdd strtoull wrapper for VS2010, pointing to MS implementation
baldurk [Thu, 13 Oct 2016 17:24:23 +0000 (19:24 +0200)]
Add strtoull wrapper for VS2010, pointing to MS implementation

7 years agoGive all complex lambdas an explicit return type
baldurk [Thu, 13 Oct 2016 17:23:39 +0000 (19:23 +0200)]
Give all complex lambdas an explicit return type

7 years agoHLSL: phase 2e: introduce lower level addBinaryNode/UnaryNode fns
steve-lunarg [Wed, 12 Oct 2016 18:38:12 +0000 (12:38 -0600)]
HLSL: phase 2e: introduce lower level addBinaryNode/UnaryNode fns

- hlsl.struct.frag variable changed to static, assignment replacd.

- Created new low level functions addBinaryNode and addUnaryNode.  These are
  used by higher level functions such as addAssignment, and do not do any
  argument promotion or conversion of any sort.

- Two functions above are now used in RWTexture lvalue conversions.  Also,
  other direction creations of unary or binary nodes now use them, e.g, addIndex.
  This cleans up some existing code.

- removed handling of EOpVectorTimesScalar from promote()

- removed comment from ParseHelper.cpp

7 years agoHLSL: phase 2d: minor cleanup, & allow operator[] on non-rw textures
steve-lunarg [Mon, 10 Oct 2016 16:00:14 +0000 (10:00 -0600)]
HLSL: phase 2d: minor cleanup, & allow operator[] on non-rw textures

Improve comments.
A few tweaked lines allow [] on non-rw tx.  Add test case for this.
Improve VectorTimesScalar handling.

7 years agoHLSL: phase 2c: use lValueErrorCheck in HLSL FE
steve-lunarg [Sat, 8 Oct 2016 16:54:52 +0000 (10:54 -0600)]
HLSL: phase 2c: use lValueErrorCheck in HLSL FE

This commit splits lValueErrorCheck into machine dependent and independent
parts.  The GLSL form in TParseContext inherits from and invokes the
machine dependent part in TParseContextBase.  The base form checks language
independent things.  This split does not change the set of errors tested
for: the test results are identical.

The new base class interface is now used from the HLSL FE to test lvalues.
There was one test diff due to this, where the test was writing to a uniform.
It still does the same indirections, but does not attempt a uniform write.

7 years agoHLSL: phase 2b: add l-value operator[] for RWTexture/RWBuffer
steve-lunarg [Sat, 8 Oct 2016 01:35:40 +0000 (19:35 -0600)]
HLSL: phase 2b: add l-value operator[] for RWTexture/RWBuffer

This commit adds l-value support for RW texture and buffer objects.
Supported are:

- pre and post inc/decrement
- function out parameters
- op-assignments, such as *=, +-, etc.
- result values from op-assignments.  e.g, val=(MyRwTex[loc] *= 2);

Not supported are:
- Function inout parameters
- multiple post-inc/decrement operators.  E.g, MyRWTex[loc]++++;

7 years agoHLSL: phase 2a: add r-value operator[] for RWTexture/RWBuffer
steve-lunarg [Fri, 7 Oct 2016 02:12:24 +0000 (20:12 -0600)]
HLSL: phase 2a: add r-value operator[] for RWTexture/RWBuffer

This commit adds r-value support for RW textures and buffers.
Supported is:

- Function in parameter conversions
- conversion of rvalue use to imageLoad

7 years agoMerge pull request #546 from yavn/OpImageQueryLod-with-SampledImage
John Kessenich [Wed, 12 Oct 2016 15:05:07 +0000 (09:05 -0600)]
Merge pull request #546 from yavn/OpImageQueryLod-with-SampledImage

SPV: Use SampledImage with OpImageQueryLod

7 years agoSPV: Use SampledImage with OpImageQueryLod
Maciej Jesionowski [Wed, 12 Oct 2016 13:40:37 +0000 (15:40 +0200)]
SPV: Use SampledImage with OpImageQueryLod

Khronos SPIR-V issue #74

7 years agoMerge pull request #543 from slime73/compilerwarnings
John Kessenich [Tue, 11 Oct 2016 21:31:31 +0000 (15:31 -0600)]
Merge pull request #543 from slime73/compilerwarnings

Address some compiler warnings.

7 years agofixup! Address some compiler warnings.
Alex Szpakowski [Tue, 11 Oct 2016 19:16:47 +0000 (16:16 -0300)]
fixup! Address some compiler warnings.

7 years agoMerge pull request #544 from amdrexu/feature
John Kessenich [Tue, 11 Oct 2016 15:29:30 +0000 (09:29 -0600)]
Merge pull request #544 from amdrexu/feature

SPV: Implement extension SPV_KHR_shader_draw_parameters.

7 years agoSPV: Implement extension SPV_KHR_shader_draw_parameters.
Rex Xu [Fri, 22 Jul 2016 10:15:31 +0000 (18:15 +0800)]
SPV: Implement extension SPV_KHR_shader_draw_parameters.

7 years agoMerge pull request #545 from amdrexu/bugfix
John Kessenich [Mon, 10 Oct 2016 15:43:30 +0000 (09:43 -0600)]
Merge pull request #545 from amdrexu/bugfix

Parser: Some function prototypes of interpolateAtXXX are incorrect.

7 years agoParser: Some function prototypes of interpolateAtXXX are incorrect.
Rex Xu [Mon, 10 Oct 2016 07:38:15 +0000 (15:38 +0800)]
Parser: Some function prototypes of interpolateAtXXX are incorrect.

7 years agoAddress some compiler warnings.
Alex Szpakowski [Sun, 9 Oct 2016 01:07:20 +0000 (22:07 -0300)]
Address some compiler warnings.

- Add explicit casts from long to int.
- Comment out method argument names that are unused.
- Always initialize a boolean variable before it's read.

7 years agoSPV: Distinguish between SPV and non-SPV rules for member overlap.
John Kessenich [Fri, 7 Oct 2016 17:50:25 +0000 (11:50 -0600)]
SPV: Distinguish between SPV and non-SPV rules for member overlap.

7 years agoHLSL: Add shape conversions for return values.
John Kessenich [Thu, 6 Oct 2016 22:56:54 +0000 (16:56 -0600)]
HLSL: Add shape conversions for return values.

7 years agoHLSL: Do structure conversion for return type struct-punning on non-entry-point funct...
John Kessenich [Thu, 6 Oct 2016 18:59:51 +0000 (12:59 -0600)]
HLSL: Do structure conversion for return type struct-punning on non-entry-point functions.

7 years agoMerge pull request #540 from steve-lunarg/rwbuffers
John Kessenich [Thu, 6 Oct 2016 17:47:37 +0000 (11:47 -0600)]
Merge pull request #540 from steve-lunarg/rwbuffers

HLSL: phase 1: add RWTexture and RWBuffer

7 years agoHLSL: phase 1: add RWTexture and RWBuffer
steve-lunarg [Tue, 4 Oct 2016 22:58:14 +0000 (16:58 -0600)]
HLSL: phase 1: add RWTexture and RWBuffer

There's a lot to do for RWTexture and RWBuffer, so it will be broken up into
several PRs.  This is #1.

This adds RWTexture and RWBuffer support, with the following limitations:
  * Only 4 component formats supported
  * No operator[] yet

Those will be added in other PRs.

This PR supports declarations and the Load & GetDimensions methods.  New tests are
added.

7 years agoUse pthread_mutex for global lock on Linux.
Josh Gargus [Thu, 6 Oct 2016 01:32:51 +0000 (18:32 -0700)]
Use pthread_mutex for global lock on Linux.

7 years agoMerge pull request #537 from dneto0/pass-cwd-to-gtest
John Kessenich [Wed, 5 Oct 2016 19:57:22 +0000 (13:57 -0600)]
Merge pull request #537 from dneto0/pass-cwd-to-gtest

Gtests can be run on another source tree

7 years agoCheck for out-of-range bindings during IO mapping.
steve-lunarg [Wed, 5 Oct 2016 19:40:13 +0000 (13:40 -0600)]
Check for out-of-range bindings during IO mapping.

7 years agoAllow for larger binding numbers. 65K instead of 255.
John Kessenich [Wed, 5 Oct 2016 18:31:24 +0000 (12:31 -0600)]
Allow for larger binding numbers.  65K instead of 255.

7 years agoGtests can be run on another source tree
David Neto [Wed, 5 Oct 2016 14:25:09 +0000 (10:25 -0400)]
Gtests can be run on another source tree

The gtest executable accepts a --test-root option to specify
a root directory for test files.  It defaults to the Test directory
in the source tree from which the executable is built.

For example, this lets us run test exectuables built with MinGW on Linux
on a Windows machine with its own copy of the source tree.

7 years agoMerge pull request #536 from steve-lunarg/flatten-assign-fix
John Kessenich [Wed, 5 Oct 2016 01:45:18 +0000 (19:45 -0600)]
Merge pull request #536 from steve-lunarg/flatten-assign-fix

HLSL: fix for flattening assignments from non-symbol R-values.

7 years agoHLSL: fix for flattening assignments from non-symbol R-values.
steve-lunarg [Mon, 3 Oct 2016 04:13:22 +0000 (22:13 -0600)]
HLSL: fix for flattening assignments from non-symbol R-values.

If a member-wise assignment from a non-flattened struct to a flattened struct sees a complex R-value
(not a symbol), it now creates a temporary to hold that value, to avoid repeating the R-value.
This avoids, e.g, duplicating a whole function call.  Also, it avoids re-using the AST node, making a
new one for each member inside the member loop.

The latter (re-use of AST node) was also an issue in the GetDimensions intrinsic decomposition,
so this PR fixes that one too.

7 years agoMerge pull request #533 from steve-lunarg/reflection
John Kessenich [Mon, 3 Oct 2016 19:57:32 +0000 (13:57 -0600)]
Merge pull request #533 from steve-lunarg/reflection

add reflection queries to return a TType.  Fix minor issue with inter…

7 years agoadd reflection queries to return a TType. Fix minor issue with interface names.
steve-lunarg [Wed, 21 Sep 2016 20:19:40 +0000 (14:19 -0600)]
add reflection queries to return a TType.  Fix minor issue with interface names.

- Add new queries: TProgram::getUniformTType and getUniformBlockTType,
  which return a const TType*, or nullptr on a bad index.  These are valid for
  any source language.

- Interface name for HLSL cbuffers is taken from the (only) available declaration name,
  whereas before it was always an empty string, which caused some troubles with reflection
  mapping them all to the same index slot.  This also makes it appear in the SPIR-V binary
  instead of an empty string.

- Print the binding as part of the reflection textual dump.

- TType::clone becomes const.  Needed to call it from a const method, and anyway it doesn't
  change the object it's called on.

- Because the TObjectReflection constructor is called with a TType *reference* (not pointer)
  so that it's guaranteed to pass in a type, and the "badReflection" value should use a nullptr
  there, that now has a dedicated static method to obtain the bad value.  It uses a private
  constructor, so external users can't create one with a nullptr type.

7 years agoNon-functional: Rationalizing parse helper hierarchy, step 3 (effected editable symbo...
John Kessenich [Sun, 2 Oct 2016 00:44:38 +0000 (18:44 -0600)]
Non-functional: Rationalizing parse helper hierarchy, step 3 (effected editable symbols and IO resize).

7 years agoNon-functional: Rationalizing parse helper hierarchy, step 2 (effected error messagin...
John Kessenich [Sun, 2 Oct 2016 00:07:57 +0000 (18:07 -0600)]
Non-functional: Rationalizing parse helper hierarchy, step 2 (effected error messaging and cascading errors).

7 years agoNon-functional: Rationalizing parse helper hierarchy, step 1 (effected memory of...
John Kessenich [Sat, 1 Oct 2016 23:47:40 +0000 (17:47 -0600)]
Non-functional: Rationalizing parse helper hierarchy, step 1 (effected memory of HLSL keyword map).

7 years agoHLSL: Line numbers only: Set locations (line numbers) on synthesized flattening code.
John Kessenich [Sat, 1 Oct 2016 23:17:55 +0000 (17:17 -0600)]
HLSL: Line numbers only: Set locations (line numbers) on synthesized flattening code.

7 years agoHLSL: Handle flattened I/O structs passed to function *out* parameters.
John Kessenich [Sat, 1 Oct 2016 23:11:21 +0000 (17:11 -0600)]
HLSL: Handle flattened I/O structs passed to function *out* parameters.

7 years agoNon-functional: Better use of .isParamOutput() and some other methods.
John Kessenich [Sat, 1 Oct 2016 19:30:37 +0000 (13:30 -0600)]
Non-functional: Better use of .isParamOutput() and some other methods.

7 years agoFix typo in error message.
John Kessenich [Sat, 1 Oct 2016 18:36:19 +0000 (12:36 -0600)]
Fix typo in error message.

7 years agoNon-functional: Use isOpaque() instead of compare against EbtSampler.
John Kessenich [Sat, 1 Oct 2016 18:35:01 +0000 (12:35 -0600)]
Non-functional: Use isOpaque() instead of compare against EbtSampler.

7 years agoMerge pull request #532 from steve-lunarg/automap-offsets
John Kessenich [Sat, 1 Oct 2016 18:00:51 +0000 (12:00 -0600)]
Merge pull request #532 from steve-lunarg/automap-offsets

Change binding auto-map to use provided offsets.

7 years agoChange binding auto-map to use provided offsets.
steve-lunarg [Sat, 1 Oct 2016 17:27:43 +0000 (11:27 -0600)]
Change binding auto-map to use provided offsets.

Previously, the binding auto-mapping facility was free to use any unused
binding.  This change makes auto-bindings use the same offset value as
explicit bindings.

7 years agoMerge pull request #527 from steve-lunarg/array-flattening-fix
John Kessenich [Sat, 1 Oct 2016 17:40:27 +0000 (11:40 -0600)]
Merge pull request #527 from steve-lunarg/array-flattening-fix

HLSL: Restrict uniform array flattening to sampler and texture arrays

7 years agoMerge pull request #521 from yavn/frag-shader-primitive-id-capability
John Kessenich [Sat, 1 Oct 2016 17:38:18 +0000 (11:38 -0600)]
Merge pull request #521 from yavn/frag-shader-primitive-id-capability

SPV: PrimitiveId in frag shader will emit OpCapability

7 years agoMerge pull request #531 from steve-lunarg/add-autobinding-test
John Kessenich [Sat, 1 Oct 2016 17:37:09 +0000 (11:37 -0600)]
Merge pull request #531 from steve-lunarg/add-autobinding-test

HLSL: Add a test for buffer auto-binding assignment.

7 years agoAdd a test for buffer auto-binding assignment.
steve-lunarg [Fri, 30 Sep 2016 20:26:34 +0000 (14:26 -0600)]
Add a test for buffer auto-binding assignment.

7 years agoMerge pull request #523 from amdrexu/feature2
John Kessenich [Fri, 30 Sep 2016 15:54:17 +0000 (09:54 -0600)]
Merge pull request #523 from amdrexu/feature2

Parser: Implement extension GL_AMD_gpu_shader_half_float.

7 years agoParser: Implement extension GL_AMD_gpu_shader_half_float.
Rex Xu [Fri, 29 Jul 2016 08:00:05 +0000 (16:00 +0800)]
Parser: Implement extension GL_AMD_gpu_shader_half_float.

- Add built-in types: float16_t, f16vec, f16mat.
- Add support of half float constant: hf, HF.
- Extend built-in floating-point operators: +, -, *, /, ++, --, +=, -=,
  *=, /=, ==, !=, >=, <=, >, <.
- Add support of type conversions: float16_t -> XXX, XXX -> float16_t.
- Add new built-in functions.

7 years agoAdd amend ability for anonymous blocks, so they can grow between function bodies.
John Kessenich [Fri, 30 Sep 2016 05:58:30 +0000 (23:58 -0600)]
Add amend ability for anonymous blocks, so they can grow between function bodies.

7 years agoMerge pull request #530 from annygakh/master
John Kessenich [Thu, 29 Sep 2016 23:39:01 +0000 (17:39 -0600)]
Merge pull request #530 from annygakh/master

Updated README.md

7 years agoUpdated README.md
Anny [Thu, 29 Sep 2016 23:29:58 +0000 (16:29 -0700)]
Updated README.md

Added an alternative link for cloning the repo in the build instructions

7 years agoRestrict uniform array flattening to sampler and texture arrays.
steve-lunarg [Thu, 29 Sep 2016 14:43:22 +0000 (08:43 -0600)]
Restrict uniform array flattening to sampler and texture arrays.

Previously the uniform array flattening feature would trigger on loose
uniform arrays of any basic type (e.g, floats).  This PR restricts it
to sampler and texture arrays.  Other arrays would end up in their own
uniform block (anonymous or otherwise).  (Atomic counter arrays might be an
exception, but those are not currently flattened).

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 agoSPV: PrimitiveId in frag shader will emit Geometry capability
Maciej Jesionowski [Mon, 26 Sep 2016 14:49:09 +0000 (16:49 +0200)]
SPV: PrimitiveId in frag shader will emit Geometry capability

Using PrimitiveId in a fragment shader requires declaring
an OpCapability with either Geometry or Tessellation.

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.