glslang/Test/hlsl.clipdistance-2.vert
LoopDawg c44b95fdec WIP: HLSL: handle clip/cull distance array semantic matching
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
2017-06-23 13:06:53 -06:00

16 lines
398 B
GLSL

void main(out float4 pos : SV_Position,
out float2 clip[2] : SV_ClipDistance, // array of vector float
out float2 cull[2] : SV_CullDistance) // array of vector float
{
pos = 1.0f.xxxx;
clip[0].x = 0.5f;
clip[0].y = 0.6f;
clip[1].x = 0.7f;
clip[1].y = 0.8f;
cull[0].x = 0.525f;
cull[0].y = 0.625f;
cull[1].x = 0.725f;
cull[1].y = 0.825f;
}