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:
7
Test/hlsl.clipdistance-2.frag
Normal file
7
Test/hlsl.clipdistance-2.frag
Normal file
@@ -0,0 +1,7 @@
|
||||
float4 main(in float4 pos : SV_Position,
|
||||
in float2 clip[2] : SV_ClipDistance, // array of vector float
|
||||
in float2 cull[2] : SV_CullDistance) : SV_Target0 // array of vector float
|
||||
{
|
||||
|
||||
return pos + clip[0][0] + cull[0][0];
|
||||
}
|
||||
Reference in New Issue
Block a user