mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-24 03:39:51 +00:00
ccb076ac9b
HLSL requires vec2 tessellation coordinate declarations in some cases (e.g, isoline topology), where SPIR-V requires the TessCoord qualified builtin to be a vec3 in all cases. This alters the IO form of the variable to be a vec3, which will be copied to the shader's declared type if needed. This is not a validation; the shader type must be correct.
32 lines
652 B
GLSL
32 lines
652 B
GLSL
// Test vec2 tessellation coordinate: the IO form should be a vec3, copied to a vec2
|
|
// at the entry point boundary.
|
|
|
|
struct ds_in_t
|
|
{
|
|
float4 pos : POSITION;
|
|
float3 norm : TEXCOORD0;
|
|
};
|
|
|
|
struct pcf_in_t
|
|
{
|
|
float flTessFactor [3] : SV_TessFactor;
|
|
float flInsideTessFactor : SV_InsideTessFactor;
|
|
};
|
|
|
|
struct gs_in_t
|
|
{
|
|
float4 pos : POSITION;
|
|
float3 norm : TEXCOORD0;
|
|
};
|
|
|
|
[domain ( "isoline" )]
|
|
gs_in_t main (const OutputPatch <ds_in_t, 2> i, float2 tesscoord : SV_DomainLocation, pcf_in_t pcf_data )
|
|
{
|
|
gs_in_t o;
|
|
|
|
o.pos = i[0].pos + tesscoord.x;
|
|
o.norm = i[0].norm + tesscoord.y;
|
|
|
|
return o;
|
|
}
|