This commit is contained in:
Hans-Kristian Arntzen 2018-02-22 17:00:41 +01:00
Родитель 114c2c5e37
Коммит 0673f27b7c
7 изменённых файлов: 14 добавлений и 21 удалений

Просмотреть файл

@ -1,11 +1,11 @@
static float gl_ClipDistance[2];
static float gl_CullDistance[2];
static float gl_CullDistance[1];
static float FragColor;
struct SPIRV_Cross_Input
{
float2 gl_ClipDistance0 : SV_ClipDistance0;
float2 gl_CullDistance0 : SV_CullDistance0;
float gl_CullDistance0 : SV_CullDistance0;
};
struct SPIRV_Cross_Output
@ -15,7 +15,7 @@ struct SPIRV_Cross_Output
void frag_main()
{
FragColor = ((gl_ClipDistance[0] + gl_CullDistance[0]) + gl_ClipDistance[1]) + gl_CullDistance[1];
FragColor = (gl_ClipDistance[0] + gl_CullDistance[0]) + gl_ClipDistance[1];
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
@ -23,7 +23,6 @@ SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
gl_ClipDistance[0] = stage_input.gl_ClipDistance0.x;
gl_ClipDistance[1] = stage_input.gl_ClipDistance0.y;
gl_CullDistance[0] = stage_input.gl_CullDistance0.x;
gl_CullDistance[1] = stage_input.gl_CullDistance0.y;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;

Просмотреть файл

@ -1,11 +1,11 @@
static float4 gl_Position;
static float gl_ClipDistance[2];
static float gl_CullDistance[2];
static float gl_CullDistance[1];
struct SPIRV_Cross_Output
{
float4 gl_Position : SV_Position;
float2 gl_ClipDistance0 : SV_ClipDistance0;
float2 gl_CullDistance0 : SV_CullDistance0;
float gl_CullDistance0 : SV_CullDistance0;
};
void vert_main()
@ -14,7 +14,6 @@ void vert_main()
gl_ClipDistance[0] = 0.0f;
gl_ClipDistance[1] = 0.0f;
gl_CullDistance[0] = 4.0f;
gl_CullDistance[1] = 4.0f;
}
SPIRV_Cross_Output main()
@ -25,6 +24,5 @@ SPIRV_Cross_Output main()
stage_output.gl_ClipDistance0.x = gl_ClipDistance[0];
stage_output.gl_ClipDistance0.y = gl_ClipDistance[1];
stage_output.gl_CullDistance0.x = gl_CullDistance[0];
stage_output.gl_CullDistance0.y = gl_CullDistance[1];
return stage_output;
}

Просмотреть файл

@ -1,11 +1,11 @@
static float gl_ClipDistance[2];
static float gl_CullDistance[2];
static float gl_CullDistance[1];
static float FragColor;
struct SPIRV_Cross_Input
{
float2 gl_ClipDistance0 : SV_ClipDistance0;
float2 gl_CullDistance0 : SV_CullDistance0;
float gl_CullDistance0 : SV_CullDistance0;
};
struct SPIRV_Cross_Output
@ -15,7 +15,7 @@ struct SPIRV_Cross_Output
void frag_main()
{
FragColor = ((gl_ClipDistance[0] + gl_CullDistance[0]) + gl_ClipDistance[1]) + gl_CullDistance[1];
FragColor = (gl_ClipDistance[0] + gl_CullDistance[0]) + gl_ClipDistance[1];
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
@ -23,7 +23,6 @@ SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
gl_ClipDistance[0] = stage_input.gl_ClipDistance0.x;
gl_ClipDistance[1] = stage_input.gl_ClipDistance0.y;
gl_CullDistance[0] = stage_input.gl_CullDistance0.x;
gl_CullDistance[1] = stage_input.gl_CullDistance0.y;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;

Просмотреть файл

@ -1,11 +1,11 @@
static float4 gl_Position;
static float gl_ClipDistance[2];
static float gl_CullDistance[2];
static float gl_CullDistance[1];
struct SPIRV_Cross_Output
{
float4 gl_Position : SV_Position;
float2 gl_ClipDistance0 : SV_ClipDistance0;
float2 gl_CullDistance0 : SV_CullDistance0;
float gl_CullDistance0 : SV_CullDistance0;
};
void vert_main()
@ -14,7 +14,6 @@ void vert_main()
gl_ClipDistance[0] = 0.0f;
gl_ClipDistance[1] = 0.0f;
gl_CullDistance[0] = 4.0f;
gl_CullDistance[1] = 4.0f;
}
SPIRV_Cross_Output main()
@ -25,6 +24,5 @@ SPIRV_Cross_Output main()
stage_output.gl_ClipDistance0.x = gl_ClipDistance[0];
stage_output.gl_ClipDistance0.y = gl_ClipDistance[1];
stage_output.gl_CullDistance0.x = gl_CullDistance[0];
stage_output.gl_CullDistance0.y = gl_CullDistance[1];
return stage_output;
}

Просмотреть файл

@ -1,12 +1,12 @@
#version 450
in float gl_ClipDistance[2];
in float gl_CullDistance[2];
in float gl_CullDistance[1];
layout(location = 0) out float FragColor;
void main()
{
FragColor = gl_ClipDistance[0] + gl_CullDistance[0] + gl_ClipDistance[1] + gl_CullDistance[1];
FragColor = gl_ClipDistance[0] + gl_CullDistance[0] + gl_ClipDistance[1];
}

Просмотреть файл

@ -1,6 +1,6 @@
#version 450
out float gl_ClipDistance[2];
out float gl_CullDistance[2];
out float gl_CullDistance[1];
void main()
{
@ -8,5 +8,4 @@ void main()
gl_ClipDistance[0] = 0.0;
gl_ClipDistance[1] = 0.0;
gl_CullDistance[0] = 4.0;
gl_CullDistance[1] = 4.0;
}

Просмотреть файл

@ -1935,7 +1935,7 @@ void CompilerHLSL::emit_hlsl_entry_point()
break;
case BuiltInCullDistance:
for (uint32_t cull = 0; cull < clip_distance_count; cull++)
for (uint32_t cull = 0; cull < cull_distance_count; cull++)
statement("gl_CullDistance[", cull, "] = stage_input.gl_CullDistance", cull / 4, ".", "xyzw"[cull & 3], ";");
break;