HLSL: add geometry stage support for clip/cull distance

Changes:

(1) Allow clip/cull builtins as both input and output in the same shader stage.  Previously,
not enough data was tracked to handle this.

(2) Handle the extra array dimension in GS inputs.  The synthesized external variable can
now be created with the extra array dimension if needed, and the form conversion code is
able to handle it as well.

For example, both of these GS inputs would result in the same synthesized external type:

    triangle in float4 clip[3] : SV_ClipDistance

    triangle in float2 clip[3][2] : SV_ClipDistance

In the second case, the inner array dimension packs with the 2-vector of floats into an array[4],
which there is an array[3] of due to the triangle geometry.
This commit is contained in:
LoopDawg
2017-08-28 14:02:19 -06:00
parent ea0c1643ab
commit 5e5b12e931
13 changed files with 3448 additions and 204 deletions

View File

@@ -104,8 +104,10 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.clipdistance-2.geom", "main"},
{"hlsl.clipdistance-2.vert", "main"},
{"hlsl.clipdistance-3.frag", "main"},
{"hlsl.clipdistance-3.geom", "main"},
{"hlsl.clipdistance-3.vert", "main"},
{"hlsl.clipdistance-4.frag", "main"},
{"hlsl.clipdistance-4.geom", "main"},
{"hlsl.clipdistance-4.vert", "main"},
{"hlsl.clipdistance-5.frag", "main"},
{"hlsl.clipdistance-5.vert", "main"},