HLSL: allow mixed user & builtin members in hull shader output structure

Hull shaders have an implicitly arrayed output.  This is handled by creating an arrayed form of the
provided output type, and writing to the element of it indexed by InvocationID.

The implicit indirection into that array was causing some troubles when copying to a split
structure.  handleAssign was able to handle simple symbol lvalues, but not an lvalue composed
of an indirection into an array.
This commit is contained in:
LoopDawg
2017-09-10 09:46:55 -06:00
parent ba6a3c290e
commit a5d8616478
11 changed files with 310 additions and 20 deletions

17
Test/hlsl.hull.4.tesc Normal file
View File

@@ -0,0 +1,17 @@
// Test mixed output structure: user and builtin members. Hull shaders involve extra
// logic in this case, over and above e.g. pixel or vertex stages, which is related to
// the implicit array dimension.
struct HS_Output
{
float tessFactor[3] : SV_TessFactor;
float coord : TEXCOORD0;
};
[domain("tri")]
[outputcontrolpoints(3)]
HS_Output main ( )
{
HS_Output output = (HS_Output)0;
return output;
}