Commit Graph

2227 Commits

Author SHA1 Message Date
John Kessenich
a58cc9ffdf GLSL reflection: Fix #985: reflect runtime sized arrays having no constant index. 2017-07-28 17:37:31 -06:00
John Kessenich
a353bf1f20 Nonfunctional: Add reflect test case, and fix long lines in reflection code. 2017-07-28 17:32:27 -06:00
John Kessenich
2ceec68109 Nonfunctional: Shorten some lines to the coding standard, to retrigger failed test run. 2017-07-28 16:21:04 -06:00
John Kessenich
38151b2f45 Merge pull request #1002 from amdrexu/bugfix
SPV: Memory qualifiers should decorate top-level block members
2017-07-28 01:35:42 +09:00
Rex Xu
286ca432cf SPV: Memory qualifiers should decorate top-level block members 2017-07-27 14:33:16 +08:00
John Kessenich
f1f5058a3c Merge pull request #997 from LoopDawg/clipcull-semantic
HLSL: handle multiple clip/cull semantic IDs
2017-07-27 08:38:03 +09:00
LoopDawg
307b6507b3 HLSL: handle multiple clip/cull semantic IDs
HLSL allows several variables to be declared.  There are packing rules involved:
e.g, a float3 and a float1 can be packed into a single array[4], while for a
float3 and another float3, the second one will skip the third array entry to
avoid straddling

This is implements that ability.  Because there can be multiple variables involved,
and the final output array will often be a different type altogether (to fuse
the values into a single destination), a new variable is synthesized, unlike the prior
clip/cull support which used the declared variable.  The new variable name is
taken from one of the declared ones, so the old tests are unchanged.

Several new tests are added to test various packing scenarios.

Only two semantic IDs are supported: 0, and 1, per HLSL rules.  This is
encapsulated in

     static const int maxClipCullRegs = 2;

and the algorithm (probably :) ) generalizes to larger values, although there
are a few issues around how HLSL would pack (e.g, would 4 scalars be packed into
a single HLSL float4 out reg?  Probably, and this algorithm assumes so).
2017-07-26 11:18:09 -06:00
John Kessenich
d2d3a14237 SPV: Update to latest 1.0 headers, removing redundancies in GLSL.ext.AMD.h. 2017-07-25 21:03:29 -06:00
John Kessenich
cd52fd5a42 Merge pull request #1000 from LoopDawg/samplecmpzero-cubearray-fix
Fix dref explicit LOD form of sample with cube texture arrays
2017-07-25 16:36:17 +09:00
LoopDawg
ef94b1a5ca Fix dref explicit LOD form of sample with cube texture arrays
The dref parameter was being used as the LOD.  Now it it's properly the dref.
2017-07-24 18:45:37 -06:00
John Kessenich
53863a3a90 GLSL: Implement version 320 for ES. 2017-07-23 13:54:15 -06:00
John Kessenich
9353f1afab GLSL: Add version-number checking. 2017-07-23 11:49:42 -06:00
John Kessenich
67eb497002 SPV/OpenGL: Require locations on non-opaque uniform variables. 2017-07-21 13:37:46 -06:00
John Kessenich
ab0086754e Merge pull request #991 from LoopDawg/resource-set-binding-fix
HLSL: Fix crash with --resource-set-binding [n] (global form, not per-register form)
2017-07-22 01:59:42 +09:00
John Kessenich
a2b71902e2 Reflection: Fix #977: Expose getBinding(), use in new getUniformBinding(). 2017-07-20 16:44:17 -06:00
LoopDawg
52017192e5 Fix crash with --resource-set-binding [n] (common set form, not per-register form)
--resource-set-binding has a mode which allows per-register assignments of
bindings and descriptor sets on the command line, and another accepting a
single descriptor set value to assign to all variables.

The former worked, but the latter would crash when assigning the values.
This fixes it, and makes the former case a bit more robust against premature
termination of the pre-register values, which must come in (regname,set,binding)
triples.

This also allows the form "--resource-set-binding stage setnum", which was
mentioned in the usage message, but did not parse.

The operation of the per-register form of this option is unchanged.
2017-07-18 11:15:40 -06:00
John Kessenich
0e392aa92e Merge pull request #996 from KhronosGroup/decorate-parameters
SPV: Decorate parameters
2017-07-18 03:51:02 -06:00
John Kessenich
961cd35b73 SPV: Fix #995: Include memory decorations on parameters. 2017-07-18 03:07:43 -06:00
John Kessenich
fad6297206 SPV: Non-functional: support lists of decorations per parameter. 2017-07-18 02:46:59 -06:00
John Kessenich
198652a6d4 Merge pull request #994 from KhronosGroup/opaque-init
HLSL: Fix #980: flatten opaque initializers to use aliases.
2017-07-16 06:01:38 -06:00
John Kessenich
0e6e2ffd9c Fix #980: flatten opaque initializers to use aliases. 2017-07-16 05:46:13 -06:00
John Kessenich
37c202aa02 Merge pull request #992 from polarina/null-deref-fix
Fix NULL pointer dereference in TParseContext::builtInOpCheck
2017-07-16 01:16:55 -06:00
Gabríel Arthúr Pétursson
b5d9c11e1a Fix NULL pointer dereference in TParseContext::builtInOpCheck 2017-07-15 15:22:50 +00:00
John Kessenich
91e69c03bd SPV: Address #989: Don't add Location to built-ins when automapping. 2017-07-14 05:54:05 -06:00
John Kessenich
56d2b9904e Merge pull request #987 from KhronosGroup/global-std140
Address part B of #982: $Global will use std140 instead of HLSL offsets.
2017-07-14 05:45:50 -06:00
John Kessenich
735d7e56a6 Address part A of #982: $Global will use std140 instead of HLSL offsets.
From comment about this:
Adjust alignment for HLSL rules
TODO: make this consistent in early phases of code: adjusting this late means inconsistencies with earlier code, which for reflection is an issue.
Until reflection is brought in sync with these adjustments, don't apply to $Global,
which is the most likely to rely on reflection, and least likely to rely
implicit layouts.
2017-07-13 11:39:16 -06:00
John Kessenich
1e4a721cef Merge pull request #978 from LoopDawg/global-const-init-fix
HLSL: support global const initializers from non-constant rvalues
2017-07-13 08:29:53 -06:00
John Kessenich
d854ac8b71 Merge pull request #983 from LoopDawg/warning-fix
Fix StandAlone.cpp compilation warnings
2017-07-13 07:14:26 -06:00
LoopDawg
b97b25e40b Fix StandAlone.cpp compilation warnings
find_first_of returns size_t, was overflowing int.
2017-07-12 09:05:05 -06:00
LoopDawg
0fca0bafaf WIP: HLSL: support global const initializers from non-constant rvalues
Semantic test left over from other source languages is removed, since this is permitted by HLSL.
Also, to support the functionality, a targeted test is performed for this case and it is
turned into a EvqGlobal qualifier to create an AST initialization segment when needed.

Constness is now propagated up aggregate chains during initializer construction.  This
handles hierarchical cases such as the distinction between:

    static const float2 a[2] = { { 1, 2 }, { 3, 4} };

vs

    static const float2 a[2] = { { 1, 2 }, { cbuffer_member, 4} };

The first of which can use a first class constant initalization, and the second cannot.
2017-07-11 13:41:39 -06:00
John Kessenich
652db16ff1 Build: Fix #975: shut up a compiler warning (code was fine). 2017-07-07 10:22:25 -06:00
John Kessenich
4b1a890ba1 Nonfunctional, infrastructure: Clean up Test directory droppings.
The multithreaded outputs in particular can be troublesome when searching.
2017-07-06 12:06:30 -06:00
John Kessenich
645fdaa7cf Merge pull request #971 from amdrexu/bugfix
HLSL: Translate directive [flatten] and [branch] to SPV control mask.
2017-07-06 00:44:32 -06:00
Rex Xu
57e65929e4 HLSL: Translate directive [flatten] and [branch] to SPV control mask. 2017-07-06 11:31:33 +08:00
John Kessenich
423fae4858 Tests: Add a test for concurrent use of std430 and push_constant. 2017-07-05 18:34:15 -06:00
John Kessenich
9645f78293 Merge pull request #965 from chaoc/spv-khr-post-depth-coverage
Implement SPV_KHR_post_depth_coverage
2017-07-05 14:48:19 -06:00
chaoc
c120452754 Implement SPV_KHR_post_depth_coverage
Added support for both extension GL_ARB_post_depth_coverage and GL_EXT_post_depth_coverage.
2017-07-05 12:27:15 -07:00
John Kessenich
33bf7b2f89 Merge pull request #974 from LoopDawg/anyall-types
HLSL: handle type conversion for any/all intrinsics
2017-07-05 13:12:08 -06:00
LoopDawg
54b9ff9c34 HLSL: handle type conversion for any/all intrinsics
HLSL allows float/etc types for any/all intrinsics, while the
SPIR-V opcode requires bool.  This adds a simple decomposition
to type convert the argument.  It could get a little more clever
in some of the type cases if it ever had to.
2017-07-05 12:19:39 -06:00
John Kessenich
17b5f9175d Merge pull request #969 from d3x0r/patch-1
Add option to skip installation
2017-07-04 11:00:42 -06:00
John Kessenich
3f70d405db Merge pull request #970 from rohith10/master
Fix CMake scripts to set the POSITION_INDEPENDENT_CODE property correctly
2017-07-04 11:00:23 -06:00
Rohith Chandran
6206091e63 Fix CMake scripts: The set_property script can be used to set only a single property, so now setting the POSITION_INDEPENDENT_CODE property correctly. 2017-07-04 10:53:45 -04:00
d3x0r
4593312490 Update CMakeLists.txt 2017-07-04 06:01:09 -07:00
d3x0r
4e53d9052d Update CMakeLists.txt 2017-07-04 06:00:35 -07:00
d3x0r
89de217f01 Update CMakeLists.txt 2017-07-04 06:00:04 -07:00
d3x0r
9c6ea324cb Update CMakeLists.txt 2017-07-04 05:59:34 -07:00
d3x0r
57a2b22d34 Update CMakeLists.txt 2017-07-04 05:59:03 -07:00
d3x0r
cde46127a1 Update CMakeLists.txt 2017-07-04 05:58:07 -07:00
d3x0r
02ed9eb2a1 Update CMakeLists.txt 2017-07-04 05:57:47 -07:00
d3x0r
42b6926192 Update CMakeLists.txt 2017-07-04 05:57:08 -07:00