HLSL: struct splitting: assignments of hierarchical split types
This commit adds support for copying nested hierarchical types of split types. E.g, a struct of a struct containing both user and builtin interstage IO variables. When copying split types, if any subtree does NOT contain builtin interstage IO, we can copy the whole subtree with one assignment, which saves a bunch of AST verbosity for memberwise copies of that subtree.
This commit is contained in:
21
Test/hlsl.struct.split.trivial.geom
Normal file
21
Test/hlsl.struct.split.trivial.geom
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
struct PS_IN
|
||||
{
|
||||
float4 pos : SV_Position;
|
||||
};
|
||||
|
||||
struct GS_OUT
|
||||
{
|
||||
float4 pos : SV_Position;
|
||||
};
|
||||
|
||||
[maxvertexcount(3)]
|
||||
void main(triangle PS_IN i[3], inout TriangleStream <GS_OUT> ts)
|
||||
{
|
||||
GS_OUT o;
|
||||
|
||||
for (int x=0; x<3; ++x) {
|
||||
o.pos = i[x].pos;
|
||||
ts.Append(o);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user