HLSL: handle clip and cull distance input builtin type conversion
authorLoopDawg <sk_opengl@khasekhemwy.net>
Wed, 23 Aug 2017 18:34:42 +0000 (12:34 -0600)
committerLoopDawg <sk_opengl@khasekhemwy.net>
Thu, 24 Aug 2017 14:35:40 +0000 (08:35 -0600)
commite2cda3c2d755d58fe09f737f5b53efb24dba0329
tree488a82eaf08c4e33bad174baaee4d54aa8b18593
parent778806a69246b8921e867e839c9e87ccddc924f2
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.
27 files changed:
Test/baseResults/hlsl.clipdistance-1.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-1.geom.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-2.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-2.geom.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-3.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-4.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-5.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-6.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-7.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-8.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.clipdistance-9.frag.out [new file with mode: 0644]
Test/baseResults/hlsl.semantic.geom.out
Test/baseResults/hlsl.semantic.vert.out
Test/hlsl.clipdistance-1.frag [new file with mode: 0644]
Test/hlsl.clipdistance-1.geom [new file with mode: 0644]
Test/hlsl.clipdistance-2.frag [new file with mode: 0644]
Test/hlsl.clipdistance-2.geom [new file with mode: 0644]
Test/hlsl.clipdistance-3.frag [new file with mode: 0644]
Test/hlsl.clipdistance-4.frag [new file with mode: 0644]
Test/hlsl.clipdistance-5.frag [new file with mode: 0644]
Test/hlsl.clipdistance-6.frag [new file with mode: 0644]
Test/hlsl.clipdistance-7.frag [new file with mode: 0644]
Test/hlsl.clipdistance-8.frag [new file with mode: 0644]
Test/hlsl.clipdistance-9.frag [new file with mode: 0644]
gtests/Hlsl.FromFile.cpp
hlsl/hlslParseHelper.cpp
hlsl/hlslParseHelper.h