renderer/vulkan: Make gl_Position invariant. (#48)

This fixes an issue with black artifacts in Pokemon games on Apple GPUs.
If the vertex calculations differ slightly between render passes, it can
cause parts of model faces to fail depth test.
This commit is contained in:
Steveice10 2023-08-07 23:37:38 -07:00 committed by GPUCode
parent 89226eea2a
commit edd8de29ae

View File

@ -46,7 +46,7 @@ static std::string GetVertexInterfaceDeclaration(bool is_output, bool use_clip_p
if (is_output) {
// gl_PerVertex redeclaration is required for separate shader object
out += "out gl_PerVertex {\n";
out += " vec4 gl_Position;\n";
out += " invariant vec4 gl_Position;\n";
if (use_clip_planes) {
out += " float gl_ClipDistance[2];\n";
}