Commit Graph

21 Commits

Author SHA1 Message Date
John Kessenich
71c100d7c0 GLSL output: Removed fixed-size buffer; fixes #769.
Makes some white-space differences in most output, plus a few cases
where more could have been put out but was cut short by the previous
fix-sized buffer.
2017-03-14 19:51:29 -06:00
John Kessenich
02467d8d94 HLSL: Wrap the entry-point; need to write 'in' args, and support 'inout' args.
This needs some render testing, but is destined to be part of master.

This also leads to a variety of other simplifications.
 - IO are global symbols, so only need one list of linkage nodes (deferred)
 - no longer need parse-context-wide 'inEntryPoint' state, entry-point is localized
 - several parts of splitting/flattening are now localized
2017-02-06 22:58:32 -07:00
steve-lunarg
0842dbb39a HLSL: use HLSL parser to parse HLSL intrinsic prototypes, enable int/bool mats
This PR adds a CreateParseContext() fn analogous to CreateBuiltInParseables(),
to create a language specific built in parser.  (This code was present before
but not encapsualted in a fn).  This can now be used to create a source language
specific parser for builtins.

Along with this, the code creating HLSL intrinsic prototypes can now produce
them in HLSL syntax, rather than GLSL syntax.  This relaxes certain prior
restrictions at the parser level.  Lower layers (e.g, SPIR-V) may still have
such restrictions, such as around Nx1 matrices: this code does not impact
that.

This PR also fleshes out matrix types for bools and ints, both of which were
partially in place before.  This was easier than maintaining the restrictions
in the HLSL prototype generator to avoid creating protoypes with those types.

Many tests change because the result type from intrinsics moves from "global"
to "temp".

Several new tests are added for the new types.
2016-11-16 11:19:22 -07:00
John Kessenich
d3f1122a44 Whole stack: Fix stale types in the AST linker object nodes, fixing #557.
Rationalizes the entire tracking of the linker object nodes, effecting
GLSL, HLSL, and SPIR-V, to allow tracked objects to be fully edited before
their type snapshot for linker objects.

Should only effect things when the rest of the AST contained no reference to
the symbol, because normal AST nodes were not stale. Also will only effect such
objects when their types were edited.
2016-11-05 10:22:33 -06:00
steve-lunarg
6b596682c9 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.
2016-10-20 14:50:12 -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
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
6b71c400f8 HLSL: Remove extraneous built-in member decorations for IO structs used in non-IO situations. 2016-09-19 22:16:09 -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
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
1a4b775cd5 HLSL: Correct line numbers for function definitions. 2016-09-02 19:05:24 -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
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
a05d8b5604 HLSL: Remove recent change to put locations on SV_TARGET*.
This put locations on members of structures, which is not allowed
in either AST or SPIR-V.

This was caught by asserts in the debug build.
2016-08-29 16:49:39 -06:00
John Kessenich
510d83b384 HLSL: Create test results for the previous commits. 2016-08-29 16:34:12 -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
Dan Baker
2c646b7afa Updating tests, sadly every single HLSL test needs updating becuase of the language identifier 2016-08-15 16:25:55 -04:00
John Kessenich
96e9f47cbb HLSL: Implement the register production. 2016-07-29 14:28:39 -06:00
John Kessenich
fea226ba43 HLSL: Add shape conversions for scalar -> vector assigments.
Also, this allows turning on the error check for a failed assigment
when parsing.

This makes 39 HLSL tests have a working assignment that was previously
silently dropped, due to lack of this functionality.
2016-07-28 18:41:20 -06:00
LoopDawg
a78b02941b HLSL: Add SampleCmp and SampleCmpLevelZero texture methods 2016-07-20 09:57:03 -06:00