2107 Commits

Author SHA1 Message Date
John Kessenich
e00e8f45a6 GLSL: replace general missing functionality with specific messages. 2017-06-05 16:42:33 -06:00
John Kessenich
21369c825a Merge pull request #912 from amdrexu/feature
Implement the extension GL_AMD_texture_gather_bias_lod
2017-06-05 09:08:12 -06:00
Rex Xu
225e0fcadd Implement the extension GL_AMD_texture_gather_bias_lod 2017-06-05 16:41:06 +08:00
John Kessenich
94c18a84cd GLSL: Fix bug setting component=0 for an auto-location assignment.
Setting component=0 is later taken to mean the shader did so, which
is not always legal. It should instead set the component as not set
by the shader.
2017-06-04 13:17:20 -06:00
John Kessenich
8de7e7bf14 GLSL: Error when using location on an arrayed block.
This implements a recent change to the GLSL specification to enforce
this ill-defined situation.
2017-06-04 13:05:50 -06:00
John Kessenich
99f289d438 Merge pull request #899 from antiagainst/rm-empty-cpps
Remove empty cpp files
2017-06-03 15:29:06 -06:00
John Kessenich
0b94a31ee9 Merge pull request #915 from LoopDawg/subvec4-intrinsic
HLSL: add test coverage for sub-vec4 texture intrinsics
2017-06-03 15:28:11 -06:00
John Kessenich
70942e5f84 Merge pull request #905 from KhronosGroup/flatten-opaque-structs
SPV: When passing structs of opaque types, flatten and pass the membe…
2017-06-02 18:48:26 -06:00
John Kessenich
f31507421b HLSL: Convert run-time sampler assignments to compile-time aliases.
For "s.m = t", a sampler member assigned a sampler, make t an alias
for s.m, and when s.m is flattened, it will flatten to the alias t.
Normally, assignments to samplers are disallowed.
2017-06-02 18:27:21 -06:00
John Kessenich
750c2d07f7 SPV: When passing structs of opaque types, flatten and pass the members instead.
This avoids either A) needing uniformConstant struct, or
B) initializing a struct with opaque members, as writing them is not
allowed.
2017-06-01 18:49:04 -06:00
John Kessenich
d66c5b1299 HLSL: iomapper: Fix #914. Tolerate user aliasing of bindings.
Because it is valid in HLSL to alias bindings:
A) remove validation that aliasing is not done
B) make the algorithms tolerate aliasing
2017-06-01 18:16:33 -06:00
LoopDawg
a696fd1a44 HLSL: add test coverage for sub-vec4 texture intrinsics
This changes no functional code.  There was a bit of a testing hole
in that textures templatized on sub-vec4 types were not being exercised
with any intrinsics.  This adds some basic sanity coverage of that case.
2017-06-01 13:28:12 -06:00
John Kessenich
ae99875e42 Merge pull request #907 from KhronosGroup/include
HLSL: Add an Includer to handle #include for local HLSL paths.
2017-06-01 12:37:52 -06:00
John Kessenich
5052152eef Merge pull request #913 from amdrexu/bugfix
Parser: Add missing codes for float16
2017-06-01 12:36:21 -06:00
John Kessenich
3494b4da9b HLSL: Add an Includer to handle #include. 2017-06-01 11:16:32 -06:00
Rex Xu
0848cc0725 Parser: Add missing codes for float16 2017-06-01 19:59:20 +08:00
John Kessenich
44d2728e3d Merge pull request #911 from KhronosGroup/debug-info
SPV: Add OpSource shader source code and file name.
2017-05-31 22:47:28 -06:00
John Kessenich
e485c7af58 SPV: Debug output: Include OpLine information for execution path.
Note that declaratives are not handled, only procedurals.
2017-05-31 18:50:53 -06:00
John Kessenich
121853f4df SPV: Add OpSource shader source code and file name. 2017-05-31 17:14:15 -06:00
John Kessenich
136b1e2d5d Merge pull request #856 from TiemoJung/texture_upgrade
Pure Texture to Sampled Texture Transform
2017-05-29 11:40:43 -06:00
t.jung
baf570efa5 Pure Texture to Sampled Texture Transform
Adds a transformation step to the post processing step.
Two modes are available:
1) keep
- Keeps samplers, textures and sampled textures as is
2) transform pure texture into sampled texture and remove pure samplers
- removes all pure samplers
- transforms all pure textures into its sampled counter part

Change-Id: If54972e8052961db66c23f4b7e719d363cf6edbd
2017-05-29 18:29:45 +02:00
John Kessenich
d6af18f621 Merge pull request #901 from LoopDawg/imat-construct
HLSL: Add imat, umat, and bmat constructors
2017-05-24 23:12:58 -06:00
John Kessenich
7c9129bcb7 SPV: Fix #904: Correctly check for built-in block redeclations for location check. 2017-05-24 23:10:28 -06:00
John Kessenich
84cc15f0d0 HLSL: Fix #903: Don't short-circuit && or ||. 2017-05-24 16:47:32 -06:00
John Kessenich
6e2295d340 HLSL: Fix #902: Incorrect protection against zero arguments. 2017-05-24 16:02:56 -06:00
LoopDawg
174ccb8f1d HLSL: Add imat, umat, and bmat constructors
Fixes #894
2017-05-20 21:54:16 -06:00
John Kessenich
2c6f48b1f6 Fix #373: Implicitly make gl_FragColor a location=0 output. 2017-05-20 13:23:25 -06:00
John Kessenich
1d585ac8bd SPV: Correctly enforce 'location' presence on in/out blocks.
Blocks have this on members, not the object.
2017-05-20 12:15:41 -06:00
John Kessenich
557caf2401 Merge pull request #900 from LoopDawg/tx-overloads
HLSL: allow name mangling based on texture template type
2017-05-20 11:33:54 -06:00
John Kessenich
7b8c386c5d More non-determinism fixed. 2017-05-19 23:44:51 -06:00
John Kessenich
b6cabc4f24 Fix C++ portability, non-deterministic order of argument evaluation. 2017-05-19 23:29:50 -06:00
John Kessenich
80f92a190a Fix #857: Convert uniform int to local bool for struct alias assignment.
This was done for one direction, but not both directions, so this commit
picks up the other direction.
2017-05-19 23:00:13 -06:00
John Kessenich
0d2b4713c5 HLSL: Don't do logical short-circuits when the operands are bool-vectors.
This seems a bit ill-defined, and was generating code that made OpPhi of two
operands that were Boolean vectors result in a scalar bool.
2017-05-19 20:19:00 -06:00
LoopDawg
132a28aac4 HLSL: allow name mangling based on texture template type
Name mangling did not account for the vector size in the template type of a texture.
This adds that.  The mangle is as it ever was for the vec4 case, which leaves
all GLSL behavior and most HLSL behavior uneffected.  For vec1-3 the size is added
to the mangle.

Current limitation: textures cannot presently be templatized on structured types,
so this works only for vectors of basic types.

Fixes #895.
2017-05-19 20:12:50 -06:00
Lei Zhang
ddda9cb8ee Remove empty cpp files
This solves ranlib warnings on MacOS.
2017-05-19 17:29:16 -04:00
John Kessenich
ab0847ef01 Merge pull request #896 from KhronosGroup/spv-location
SPV: Give error on not assigning locations to I/O when generating SPIR-V.
2017-05-18 21:12:04 -06:00
John Kessenich
ff164d87f1 Merge pull request #897 from LoopDawg/remap-specconstop-fix.2
Remapper: handle embedded opcode in OpSpecConstantOp
2017-05-18 18:19:12 -06:00
LoopDawg
65c2eed65d Remapper: handle embedded opcode in OpSpecConstantOp
OpSpecConstantOp contains an embedded opcode which is given as a literal
argument to the OpSpecConstantOp.  The subsequent arguments are as the
embedded op would expect, which may be a mixture of IDs and literals.  This
adds support for that to the remapper binary parser.  Upon seeing such an
embedded op, the parser flips over to parsing the argument list as
appropriate for that opcode.

Fixes #882.
2017-05-18 16:13:04 -06:00
John Kessenich
71facdf435 SPV: Give error on not assigning locations to I/O.
Also, provides an option to auto-assign locations.
Existing tests use this option, to avoid the error message,
however, it is not fully implemented yet.
2017-05-18 15:07:05 -06:00
John Kessenich
24e895b4a3 Merge pull request #860 from steve-lunarg/sb-counter-args.2
HLSL: add ability to pass struct buffers with counters to fns
2017-05-17 10:55:22 -06:00
John Kessenich
09a29d9b1a Merge pull request #893 from KhronosGroup/member-call
HLSL: Implement member functions calling member functions.

Fixes #883.
2017-05-17 09:25:57 -06:00
steve-lunarg
2bb1f39fa7 WIP: HLSL: add ability to pass struct buffers with counters to fns
This modifies function parameter passing to pass the counter
buffer associated with a struct buffer to a function as a
hidden parameter.  Similarly function declarations will have
hidden parameters added to accept the associated counter buffers.

There is a limitation: if a SB type may or may not have an associated
counter, passing it as a function parameter will assume that it does, and
the counter will appear in the linkage whether or not there is a counter
method used on the object.
2017-05-17 09:18:53 -06:00
John Kessenich
0a2a0cd3a4 HLSL: Implement member functions calling member functions. 2017-05-17 02:20:34 -06:00
John Kessenich
b29cc30cdb Merge pull request #852 from steve-lunarg/declared-builtin
track declared builtin type
2017-05-16 10:38:32 -06:00
steve-lunarg
a4bfed129f WIP: track declared builtin type [proposal]
Marking as WIP since it might deserve discussion or at least explicit consideration.

During type sanitization, the TQualifier's TBuiltInVariable type is lost.  However,
sometimes it's needed downstream.  There were already two methods in use to track
it through to places it was needed: one in the TParameter, and one in a map in the
HlslParseContext used for structured buffers.

The latter was going to be insufficient when SB types with counters are passed to
user functions, and it's proving awkward to track the data to where it's needed.
This PR holds a proposal: track the original declared builtin type in the TType,
so it's trivially available where needed.

This lets the other two mechanisms be removed (and they are in this PR).  There's a
side benefit of not losing certain types of information before the reflection interface.

This PR is only that proposal, so it changes no test results.  If it's acceptable,
I'll use it for the last piece of SB counter functionality.
2017-05-15 15:44:00 -06:00
John Kessenich
1a010b8368 Merge pull request #890 from LoopDawg/mip-operator
HLSL: add .mips[][] operator for texture types
2017-05-15 09:39:15 -06:00
LoopDawg
726bf96a72 HLSL: add .mips[][] operator for texture types
This implements mytex.mips[mip][coord] for texture types.  There is
some error testing, but not comprehensive.  The constructs can be
nested, e.g in this case the inner .mips is parsed before the completion
of the outer [][] operator.

   tx.mips[tx.mips[a][b].x][c]
2017-05-15 09:13:58 -06:00
John Kessenich
c70bbc831c Merge pull request #889 from antiagainst/travis-android
Check Android build on Travis CI
2017-05-13 16:03:12 -06:00
Lei Zhang
b21213e893 Check Android build on Travis CI.
Also stop requiring sudo privilege so that we can use containers
for testing.
2017-05-13 17:48:19 -04:00
John Kessenich
ef7efb21ca Merge pull request #888 from LoopDawg/geometry-stage-mix
HLSL: allow GS-specific methods in non-GS stages
2017-05-13 12:54:08 -06:00