steve-lunarg
0de16da2c0
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.
2016-10-12 12:39:44 -06:00
steve-lunarg
90707966ea
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]++++;
2016-10-12 12:39:44 -06:00
steve-lunarg
6b43d274e7
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
2016-10-12 12:39:44 -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
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
steve-lunarg
e0b9debda2
Flatten uniform arrays
...
This checkin adds a --flatten-uniform-arrays option which can break
uniform arrays of samplers, textures, or UBOs up into individual
scalars named (e.g) myarray[0], myarray[1], etc. These appear as
individual linkage objects.
Code notes:
- shouldFlatten internally calls shouldFlattenIO, and shouldFlattenUniform,
but is the only flattening query directly called.
- flattenVariable will handle structs or arrays (but not yet arrayed structs;
this is tested an an error is generated).
- There's some error checking around unhandled situations. E.g, flattening
uniform arrays with initializer lists is not implemented.
- This piggybacks on as much of the existing mechanism for struct flattening
as it can. E.g, it uses the same flattenMap, and the same
flattenAccess() method.
- handleAssign() has been generalized to cope with either structs or arrays.
- Extended test infrastructure to test flattening ability.
2016-09-22 08:47:48 -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
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
f911500db8
HLSL: Non-functional; make flatten semantics be about aggregates, not just structures.
2016-09-18 23:36:39 -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
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
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
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
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
07350f3382
HLSL: Handle "fake" entry points, by undoing their built-in variable declarations.
2016-09-02 20:24:07 -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
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
John Kessenich
830b0cc98b
HLSL: Start location numbering with the entry-point return value.
...
Also, increment location numbers by the size of the objects.
2016-08-29 18:10:47 -06:00
John Kessenich
81d4714908
Merge branch 'HLSL_Semantic_Mapping' of https://github.com/dankbaker/glslang into dankbaker-HLSL_Semantic_Mapping
2016-08-29 16:07:29 -06:00
John Kessenich
6a70eb7161
HLSL: Emulate write-to-output on return-from-entry-point, for return value.
...
This fixes issue #487 and #480 .
It also correctly handles output parameters from the entry point.
2016-08-28 20:13:07 -06:00
John Kessenich
b9e39120b4
HLSL: Partially address issue #463 : accept GLSL layout(...).
...
This includes all "per variable" layout qualifiers, but the
key ones mattering and tested for now are:
set=
binding=
constant_id=
push_constant
2016-08-17 17:38:45 -06:00
steve-lunarg
c4a1307403
HLSL: add implicit promotions for assignments and function returns.
2016-08-09 13:48:47 -06:00
John Kessenich
b38f071605
HLSL: Add back in the [subcomponent] part of a 'register' decl.
2016-07-30 10:30:51 -06:00
John Kessenich
96e9f47cbb
HLSL: Implement the register production.
2016-07-29 14:28:39 -06:00
John Kessenich
82d6baf86f
HLSL: Implement packoffset production.
2016-07-29 13:03:50 -06:00
John Kessenich
a26a5170a3
Non-functional: Rationalize location and use of mapTypeToConstructor().
2016-07-28 16:56:52 -06:00
steve-lunarg
2de329112b
HLSL: allow uint literals, and add test for numeric suffixes
2016-07-28 14:49:48 -06:00
John Kessenich
64723c20b5
Merge pull request #406 from steve-lunarg/pp_line
...
HLSL: enable #line extension by default for HLSL source.
2016-07-26 09:39:48 -06:00
John Kessenich
3d157c510f
HLSL: cbuffer and tbuffer grammar and production.
2016-07-25 16:05:33 -06:00
LoopDawg
6256146ef3
HLSL: enable #line extension by default for HLSL source.
2016-07-23 10:45:00 -06:00
LoopDawg
a2b7991497
HLSL: Add SampleBias and SampleGrad, and associated tests
2016-07-15 11:38:49 -06:00
LoopDawg
4886f69734
HLSL: Sampler/texture declarations, method syntax, partial Sample method
2016-07-12 15:57:46 -06:00
John Kessenich
7f349c73db
Build: Remove causes of pedantic warnings. Addresses issue #352 and PR #242 .
2016-07-08 22:09:10 -06:00
John Kessenich
5e69ec683d
HLSL: Add typedef grammar and production.
2016-07-05 00:02:40 -06:00
John Kessenich
d02dc5d05a
HLSL: Implement switch/case/default.
2016-07-01 00:04:11 -06:00
LoopDawg
4624a02e21
Add lerp, fix sincos return type, ret type tests, non-square mats, HLSL->AST tx semantics
2016-06-21 10:10:48 -06:00
John Kessenich
5aa59e2044
HLSL: Map parameter qualifiers from generic to function-specific and entry-point specific.
2016-06-17 15:52:46 -06:00
John Kessenich
b901ade058
SPV: Non-functional: Condense SPV-related versioning, and rationalize all uses.
2016-06-16 23:31:29 -06:00
LoopDawg
589107095c
Implement atomic ops, bit conversions, fix fwidth stage mask, fix saturate dest modifier.
2016-06-13 20:50:36 -06:00
John Kessenich
cd784bc561
Merge pull request #337 from steve-lunarg/intrinsics
...
HLSL: Add decompositions for some intrinsics.
2016-06-13 08:54:45 -06:00
John Kessenich
630dd7da43
HLSL: Flesh out misc. declaration grammar: semantics/registers/annotations/precise/etc.
...
Details within these bear even more fleshing out, but would like to have
that driven by actual need.
2016-06-12 23:54:31 -06:00
John Kessenich
e6e7494e2a
HLSL: Implement basic "struct" grammar.
2016-06-12 23:54:31 -06:00
LoopDawg
592860cae5
Add decompositions for some HLSL intrinsics.
2016-06-10 17:11:18 -06:00
John Kessenich
077e052a8f
HLSL: Implement proper nesting of symbol-table scopes and identifier searching.
2016-06-09 02:03:46 -06:00
John Kessenich
119f8f6906
HLSL: Flesh out the loop grammar and productions.
2016-06-05 15:44:07 -06:00
John Kessenich
0d2b6de45b
HLSL: Attribute grammar and if-else grammar/productions.
2016-06-05 12:32:18 -06:00
John Kessenich
8d72f1a2c4
Full stack: distinguish between a scalar and a vector of size 1.
...
There have been GLSL extensions considering this, and HLSL does it.
This is a fully backward compatible change that allows this distinction.
2016-05-20 12:14:39 -06:00