Johannes van Waveren [Fri, 21 Oct 2016 08:21:46 +0000 (17:21 +0900)]
Merge remote-tracking branch 'upstream/master'
Johannes van Waveren [Fri, 21 Oct 2016 08:21:12 +0000 (17:21 +0900)]
fixed MSVC 2015 compile warnings
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
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
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
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
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.
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.
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.
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.
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.
John Kessenich [Sun, 16 Oct 2016 18:22:20 +0000 (12:22 -0600)]
HLSL: Turn on tests for groupshared.
John Kessenich [Sun, 16 Oct 2016 18:12:11 +0000 (12:12 -0600)]
HLSL: Support SV_Coverage and SV_DispatchThreadId; catch SV_GroupIndex.
John Kessenich [Sun, 16 Oct 2016 17:50:46 +0000 (11:50 -0600)]
Build: Fix unsigned/signed warning.
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
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
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.
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.
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
Josh Gargus [Sat, 15 Oct 2016 22:19:59 +0000 (15:19 -0700)]
Use a recursive mutex.
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.
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.
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.
Rex Xu [Fri, 14 Oct 2016 09:41:45 +0000 (17:41 +0800)]
SPV: Add missing extension declarations for certain AMD extensions.
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[]
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.
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.
baldurk [Thu, 13 Oct 2016 18:05:13 +0000 (20:05 +0200)]
Update HexFloat tests to use non-enum class enum values
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.
baldurk [Thu, 13 Oct 2016 17:32:37 +0000 (19:32 +0200)]
Change {} constructor brackets to ()
baldurk [Thu, 13 Oct 2016 17:31:15 +0000 (19:31 +0200)]
Change "using x = y;" to "typedef y x;" statements
baldurk [Thu, 13 Oct 2016 17:30:27 +0000 (19:30 +0200)]
Explicitly implement default constructors
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
baldurk [Thu, 13 Oct 2016 17:28:20 +0000 (19:28 +0200)]
Change enum class to plain enum
baldurk [Thu, 13 Oct 2016 17:25:52 +0000 (19:25 +0200)]
Change constructor to use ()s instead of {}s
baldurk [Thu, 13 Oct 2016 17:24:42 +0000 (19:24 +0200)]
Add #include <cstdint> for std::uint32_t usage
baldurk [Thu, 13 Oct 2016 17:24:23 +0000 (19:24 +0200)]
Add strtoull wrapper for VS2010, pointing to MS implementation
baldurk [Thu, 13 Oct 2016 17:23:39 +0000 (19:23 +0200)]
Give all complex lambdas an explicit return type
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
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.
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.
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]++++;
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
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
Maciej Jesionowski [Wed, 12 Oct 2016 13:40:37 +0000 (15:40 +0200)]
SPV: Use SampledImage with OpImageQueryLod
Khronos SPIR-V issue #74
John Kessenich [Tue, 11 Oct 2016 21:31:31 +0000 (15:31 -0600)]
Merge pull request #543 from slime73/compilerwarnings
Address some compiler warnings.
Alex Szpakowski [Tue, 11 Oct 2016 19:16:47 +0000 (16:16 -0300)]
fixup! Address some compiler warnings.
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.
Rex Xu [Fri, 22 Jul 2016 10:15:31 +0000 (18:15 +0800)]
SPV: Implement extension SPV_KHR_shader_draw_parameters.
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.
Rex Xu [Mon, 10 Oct 2016 07:38:15 +0000 (15:38 +0800)]
Parser: Some function prototypes of interpolateAtXXX are incorrect.
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.
John Kessenich [Fri, 7 Oct 2016 17:50:25 +0000 (11:50 -0600)]
SPV: Distinguish between SPV and non-SPV rules for member overlap.
John Kessenich [Thu, 6 Oct 2016 22:56:54 +0000 (16:56 -0600)]
HLSL: Add shape conversions for return values.
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.
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
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.
Josh Gargus [Thu, 6 Oct 2016 01:32:51 +0000 (18:32 -0700)]
Use pthread_mutex for global lock on Linux.
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
steve-lunarg [Wed, 5 Oct 2016 19:40:13 +0000 (13:40 -0600)]
Check for out-of-range bindings during IO mapping.
John Kessenich [Wed, 5 Oct 2016 18:31:24 +0000 (12:31 -0600)]
Allow for larger binding numbers. 65K instead of 255.
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.
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.
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.
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…
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.
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).
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).
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).
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.
John Kessenich [Sat, 1 Oct 2016 23:11:21 +0000 (17:11 -0600)]
HLSL: Handle flattened I/O structs passed to function *out* parameters.
John Kessenich [Sat, 1 Oct 2016 19:30:37 +0000 (13:30 -0600)]
Non-functional: Better use of .isParamOutput() and some other methods.
John Kessenich [Sat, 1 Oct 2016 18:36:19 +0000 (12:36 -0600)]
Fix typo in error message.
John Kessenich [Sat, 1 Oct 2016 18:35:01 +0000 (12:35 -0600)]
Non-functional: Use isOpaque() instead of compare against EbtSampler.
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.
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.
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
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
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.
steve-lunarg [Fri, 30 Sep 2016 20:26:34 +0000 (14:26 -0600)]
Add a test for buffer auto-binding assignment.
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.
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.
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.
John Kessenich [Thu, 29 Sep 2016 23:39:01 +0000 (17:39 -0600)]
Merge pull request #530 from annygakh/master
Updated 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
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).
John Kessenich [Thu, 29 Sep 2016 16:27:57 +0000 (10:27 -0600)]
HLSL: Fix merge conflict.
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.
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.
John Kessenich [Tue, 27 Sep 2016 20:38:57 +0000 (14:38 -0600)]
HLSL: Rationalize combination of type arrayness and name arrayness.
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
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.
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
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.
Dominik Witczak [Tue, 27 Sep 2016 07:51:34 +0000 (09:51 +0200)]
#517: Enable AMD extensions by default
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.
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
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.
Rex Xu [Mon, 26 Sep 2016 07:53:40 +0000 (15:53 +0800)]
SPV: OpGroupBroadcast is unable to handle vector operand.
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.