mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-30 15:13:45 +00:00
c44b95fdec
In HLSL, there are three (TODO: ??) dimensions of clip and cull distance values: * The semantic's value N, ala SV_ClipDistanceN. * The array demension, if the value is an array. * The vector element, if the value is a vector or array of vectors. In SPIR-V, clip and cull distance are arrays of scalar floats, always. This PR currently ignores the semantic N axis, and handles the other two axes by sequentially copying each vector element of each array member into sequential floats in the output array. Fixes: #946
22 lines
478 B
GLSL
22 lines
478 B
GLSL
struct VS_INPUT {
|
|
float4 Position : POSITION;
|
|
};
|
|
|
|
struct VS_OUTPUT {
|
|
float4 Position : SV_Position;
|
|
float2 ClipRect[2] : SV_ClipDistance0; // array of float2 in split struct
|
|
};
|
|
|
|
VS_OUTPUT main(const VS_INPUT v)
|
|
{
|
|
VS_OUTPUT Output;
|
|
Output.Position = 0;
|
|
|
|
Output.ClipRect[0].x = 1;
|
|
Output.ClipRect[0].y = 2;
|
|
Output.ClipRect[1].x = 3;
|
|
Output.ClipRect[1].y = 4;
|
|
|
|
return Output;
|
|
}
|