mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-03 16:41:30 +00:00
f38cca3ccf
In the hull shader, the PCF output does not participate in an argument list, so has no defined ordering. It is always put at the end of the linkage. That means the DS input reading PCF data must be be at the end of the DS linkage as well, no matter where it may appear in the argument list. This change makes sure that happens. The detection is by looking for arguments that contain tessellation factor builtins, even as a struct member. The whole struct is taken as the PCF output if any members are so qualified.
36 lines
745 B
GLSL
36 lines
745 B
GLSL
// This will test having the PCF input to the domain shader not be given at the end of
|
|
// the argument list. We must move it to the end of the linkage in this case.
|
|
|
|
struct ds_in_t
|
|
{
|
|
float4 pos : POSITION;
|
|
float3 norm : TEXCOORD0;
|
|
};
|
|
|
|
struct pcf_in_t
|
|
{
|
|
float flTessFactor [3] : SV_TessFactor;
|
|
float flInsideTessFactor : SV_InsideTessFactor;
|
|
float foo : PCF_FOO;
|
|
};
|
|
|
|
struct gs_in_t
|
|
{
|
|
float4 pos : POSITION;
|
|
float3 norm : TEXCOORD0;
|
|
};
|
|
|
|
[domain ( "tri" )]
|
|
gs_in_t main (pcf_in_t pcf_data, const OutputPatch <ds_in_t, 3> i, float3 tesscoord : SV_DomainLocation)
|
|
{
|
|
gs_in_t o;
|
|
|
|
o.pos = i[0].pos + tesscoord.x;
|
|
o.norm = i[0].norm + tesscoord.y;
|
|
|
|
tesscoord.z;
|
|
|
|
return o;
|
|
}
|
|
|