Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan/GL: Set all four coordinates to NaN instead of just W. #12227

Merged
merged 2 commits into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GPU/GLES/VertexShaderGeneratorGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ void GenerateVertexShader(const VShaderID &id, char *buffer, uint32_t *attrMask,
const char *outMin = "projPos.x < u_cullRangeMin.x || projPos.y < u_cullRangeMin.y || projPos.z < u_cullRangeMin.z";
const char *outMax = "projPos.x > u_cullRangeMax.x || projPos.y > u_cullRangeMax.y || projPos.z > u_cullRangeMax.z";
WRITE(p, " if (%s || %s) {\n", outMin, outMax);
WRITE(p, " outPos.w = u_cullRangeMax.w;\n");
WRITE(p, " outPos.xyzw = vec4(u_cullRangeMax.w);\n");
WRITE(p, " }\n");
WRITE(p, " }\n");
}
Expand Down
5 changes: 1 addition & 4 deletions GPU/Vulkan/VertexShaderGeneratorVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ static const char *vulkan_glsl_preamble =
// texcoord = 2
// fog = 3




#undef WRITE

#define WRITE p+=sprintf
Expand Down Expand Up @@ -634,7 +631,7 @@ bool GenerateVulkanGLSLVertexShader(const VShaderID &id, char *buffer) {
const char *outMin = "projPos.x < base.cullRangeMin.x || projPos.y < base.cullRangeMin.y || projPos.z < base.cullRangeMin.z";
const char *outMax = "projPos.x > base.cullRangeMax.x || projPos.y > base.cullRangeMax.y || projPos.z > base.cullRangeMax.z";
WRITE(p, " if (%s || %s) {\n", outMin, outMax);
WRITE(p, " outPos.w = base.cullRangeMax.w;\n");
WRITE(p, " outPos.xyzw = vec4(base.cullRangeMax.w);\n");
WRITE(p, " }\n");
WRITE(p, " }\n");
}
Expand Down