HLSL: handle clip and cull distance input builtin type conversion

HLSL allows a range of types for clip and cull distances.  There are
three dimensions, including arrayness, vectorness, and semantic ID.
SPIR-V requires clip and cull distance be a single array of floats in
all cases.

This code provides input side conversion between the SPIR-V form and
the HLSL form.  (Output conversion was added in PR #947 and #997).

This PR extends HlslParseContext::assignClipCullDistance to cope with
the input side conversion.  Not as much changed as appears: there was
also a lot of renaming to reflect the fact that the code now handles
either direction.

Currently, non-{frag,vert} stages are not handled, and are explicitly
rejected.

Fixes #1026.
This commit is contained in:
LoopDawg
2017-08-23 12:34:42 -06:00
parent 778806a692
commit e2cda3c2d7
27 changed files with 3272 additions and 247 deletions

View File

@@ -97,14 +97,25 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.cast.frag", "PixelShaderFunction"},
{"hlsl.charLit.vert", "main"},
{"hlsl.clip.frag", "main"},
{"hlsl.clipdistance-1.frag", "main"},
{"hlsl.clipdistance-1.geom", "main"},
{"hlsl.clipdistance-1.vert", "main"},
{"hlsl.clipdistance-2.frag", "main"},
{"hlsl.clipdistance-2.geom", "main"},
{"hlsl.clipdistance-2.vert", "main"},
{"hlsl.clipdistance-3.frag", "main"},
{"hlsl.clipdistance-3.vert", "main"},
{"hlsl.clipdistance-4.frag", "main"},
{"hlsl.clipdistance-4.vert", "main"},
{"hlsl.clipdistance-5.frag", "main"},
{"hlsl.clipdistance-5.vert", "main"},
{"hlsl.clipdistance-6.frag", "main"},
{"hlsl.clipdistance-6.vert", "main"},
{"hlsl.clipdistance-7.frag", "main"},
{"hlsl.clipdistance-7.vert", "main"},
{"hlsl.clipdistance-8.frag", "main"},
{"hlsl.clipdistance-8.vert", "main"},
{"hlsl.clipdistance-9.frag", "main"},
{"hlsl.clipdistance-9.vert", "main"},
{"hlsl.comparison.vec.frag", "main"},
{"hlsl.conditional.frag", "PixelShaderFunction"},