John Kessenich
c056adcddd
Allow for larger binding numbers. 65K instead of 255.
2016-10-05 12:31:24 -06:00
steve-lunarg
8ffc36aecc
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.
2016-10-02 16:57:58 -06:00
John Kessenich
de97fe0ad4
Non-functional: Rationalizing parse helper hierarchy, step 3 (effected editable symbols and IO resize).
2016-10-01 18:44:38 -06:00
John Kessenich
a2a5dd474e
Non-functional: Rationalizing parse helper hierarchy, step 2 (effected error messaging and cascading errors).
2016-10-01 18:07:57 -06:00
John Kessenich
273060c2d3
Non-functional: Rationalizing parse helper hierarchy, step 1 (effected memory of HLSL keyword map).
2016-10-01 17:47:40 -06:00
John Kessenich
a08c929d8e
HLSL: Line numbers only: Set locations (line numbers) on synthesized flattening code.
2016-10-01 17:17:55 -06:00
John Kessenich
d8fe2ca8e5
HLSL: Handle flattened I/O structs passed to function *out* parameters.
2016-10-01 17:11:21 -06:00
John Kessenich
c86d38bb2b
Non-functional: Better use of .isParamOutput() and some other methods.
2016-10-01 13:30:37 -06:00
John Kessenich
ba56e23e8a
Fix typo in error message.
2016-10-01 12:36:19 -06:00
John Kessenich
f571d0c037
Non-functional: Use isOpaque() instead of compare against EbtSampler.
2016-10-01 12:35:01 -06:00
John Kessenich
3e47f5f7c8
Merge pull request #523 from amdrexu/feature2
...
Parser: Implement extension GL_AMD_gpu_shader_half_float.
2016-09-30 09:54:17 -06:00
Rex Xu
c9e3c3c941
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.
2016-09-30 16:13:06 +08:00
John Kessenich
df98cc26d5
Add amend ability for anonymous blocks, so they can grow between function bodies.
2016-09-29 23:59:26 -06:00
John Kessenich
21e7e32126
HLSL: Fix merge conflict.
2016-09-29 10:27:57 -06:00
John Kessenich
4e55988a47
HLSL Tests: Tests for previous commit, to make it easier to see what's changing.
2016-09-29 10:25:15 -06:00
John Kessenich
6dbc0a7a33
Support a uniform block to hold global uniform variables.
...
Used initially just by HLSL, for $Global. Could be an option
for GLSL -> Vulkan.
2016-09-29 10:25:15 -06:00
John Kessenich
e82061de08
HLSL: Rationalize combination of type arrayness and name arrayness.
2016-09-29 10:25:15 -06:00
John Kessenich
10f7fc739c
HLSL: Reverse what the driver is told about row/column majorness, matching the row-column reversal.
2016-09-25 20:26:03 -06:00
John Kessenich
6714bcc2ca
HLSL: Fix result type of passing a flattened-aggregate to a function.
2016-09-21 17:50:12 -06:00
John Kessenich
a1e2d4952e
HLSL: Move to correct parsing of annotations, improving all annotations and recent string grammar.
2016-09-20 13:22:58 -06:00
John Kessenich
2572b19e94
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.
2016-09-19 23:12:48 -06:00
John Kessenich
86f7138706
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.
2016-09-19 20:29:45 -06:00
John Kessenich
eee9d536bc
Track separate entry-point names and mangled names...
...
... and use each in the correct way at consumption sites.
This completes issue #513 .
2016-09-19 18:09:30 -06:00
John Kessenich
6fccb3cd75
Non-functional: Sweep through the stack for consistent with "main" and entry point.
...
Partially addresses issue #513 .
2016-09-19 16:01:41 -06:00
John Kessenich
142785f324
HLSL: Change the final syntax-error printf to go to the infoLog.
...
Fixes issue #510 .
2016-09-19 14:56:55 -06:00
John Kessenich
28b28140bb
HLSL: Fix assert: ensure flattened shadow is EvqTemporary.
2016-09-19 00:19:49 -06:00
John Kessenich
5159d4f1af
HLSL: Intercept flatten aggregates passed to a function input, and copy member-by-member.
2016-09-19 00:06:19 -06:00
John Kessenich
f911500db8
HLSL: Non-functional; make flatten semantics be about aggregates, not just structures.
2016-09-18 23:36:39 -06:00
John Kessenich
d2ce838a58
HLSL: Handle flatten for reads from flatten structs and parameter passing.
2016-09-16 20:24:14 -06:00
John Kessenich
34e7ee79bb
HLSL: Improve setting and testing of interpolation qualifiers.
...
Notably, use of 'linear' on a non-input could mark it as an input.
2016-09-16 18:05:44 -06:00
John Kessenich
d21baed6bc
HLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs.
2016-09-16 03:20:03 -06:00
John Kessenich
f8e494c18c
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.
2016-09-16 01:52:14 -06:00
John Kessenich
7dc630f3da
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.
2016-09-16 01:44:43 -06:00
John Kessenich
7f702124ec
HLSL: return correct error when HLSL parsing fails.
...
At least partially addresses issue #510 .
2016-09-15 22:49:31 -06:00
John Kessenich
deb4940c17
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.
2016-09-12 11:55:47 -06:00
John Kessenich
b3e24e4359
SPV: Fix issue #506 : generalize struct deep copy to include arrays.
2016-09-11 12:33:43 -06:00
John Kessenich
cd0a78a0d9
HLSL: Flatten vertex input and fragment output structures.
...
Vulkan can't handle structures into the vertex stage or out
of the fragment stage.
2016-09-10 11:09:24 -06:00
John Kessenich
d4032293ce
HLSL: Report an error if SPIR-V for Vulkan wasn't selected.
2016-09-09 11:43:11 -06:00
John Kessenich
4bfb32e17b
Merge branch 'bugfix2' of https://github.com/amdrexu/glslang into amdrexu-bugfix2
2016-09-09 10:46:10 -06:00
John Kessenich
cfd7ce87cd
HLSL: Support register(..., spaceN) for setting the descriptor set.
...
This was suggested in issue #454 .
2016-09-05 16:03:45 -06:00
John Kessenich
e3218e270e
HLSL: Accept layout(...) also as a post-decl. Issue #454 .
2016-09-05 14:37:03 -06:00
John Kessenich
7735b94403
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.
2016-09-05 12:40:06 -06:00
John Kessenich
b804de605c
HLSL: Track binding numbers to struct instances; fixes issue #496 .
2016-09-05 12:19:18 -06:00
John Kessenich
7d01bd6f0b
HLSL: Handle swizzles on vectors of size 1. Addresses issue #453 .
2016-09-02 22:21:25 -06:00
John Kessenich
07350f3382
HLSL: Handle "fake" entry points, by undoing their built-in variable declarations.
2016-09-02 20:24:07 -06:00
John Kessenich
9e079535a0
HLSL: Handle greater/less depth modes. Fixes issue #489 .
2016-09-02 20:05:52 -06:00
John Kessenich
a305166ea4
HLSL: Error if funcion with return type doesn't return a value.
2016-09-02 19:13:36 -06:00
John Kessenich
4bf7155051
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.
2016-09-02 16:35:01 -06:00
John Kessenich
f2b7f3353b
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.
2016-09-01 17:05:23 -06:00
John Kessenich
5e56423046
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.
2016-08-31 13:46:50 -06:00