78ec0fcb22
HLSL requires builtins to be defined after texcoords in some cases.
34 lines
694 B
GLSL
34 lines
694 B
GLSL
static float4 gl_FragCoord;
|
|
static float gl_FragDepth;
|
|
static float4 FragColor;
|
|
static float4 vColor;
|
|
|
|
struct SPIRV_Cross_Input
|
|
{
|
|
float4 vColor : TEXCOORD0;
|
|
float4 gl_FragCoord : SV_Position;
|
|
};
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
float4 FragColor : SV_Target0;
|
|
float gl_FragDepth : SV_Depth;
|
|
};
|
|
|
|
void frag_main()
|
|
{
|
|
FragColor = gl_FragCoord + vColor;
|
|
gl_FragDepth = 0.5f;
|
|
}
|
|
|
|
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
|
{
|
|
gl_FragCoord = stage_input.gl_FragCoord;
|
|
vColor = stage_input.vColor;
|
|
frag_main();
|
|
SPIRV_Cross_Output stage_output;
|
|
stage_output.gl_FragDepth = gl_FragDepth;
|
|
stage_output.FragColor = FragColor;
|
|
return stage_output;
|
|
}
|