SPIRV-Cross/reference/shaders-hlsl/frag/various-glsl-ops.frag
Hans-Kristian Arntzen 4590c63b40 Fix swizzling of integers.
Add scalar swizzling to constant composites as well.
2018-01-04 13:16:56 +01:00

29 lines
640 B
GLSL

static float2 interpolant;
static float4 FragColor;
struct SPIRV_Cross_Input
{
float2 interpolant : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
};
void frag_main()
{
float4 color = float4(0.0f, 0.0f, 0.0f, EvaluateAttributeSnapped(interpolant, 0.100000001490116119384765625f.xx).x);
color += float4(0.0f, 0.0f, 0.0f, ddx_coarse(interpolant.x));
FragColor = color;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
interpolant = stage_input.interpolant;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}