summaryrefslogtreecommitdiff
path: root/opengl/libagl/matrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/libagl/matrix.cpp')
-rw-r--r--opengl/libagl/matrix.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/opengl/libagl/matrix.cpp b/opengl/libagl/matrix.cpp
index 441da38e3eb4..f175cdad6e6a 100644
--- a/opengl/libagl/matrix.cpp
+++ b/opengl/libagl/matrix.cpp
@@ -98,8 +98,9 @@ static void validate_perspective(ogles_context_t* c, vertex_t* v)
c->arrays.perspective = (c->clipPlanes.enable) ?
ogles_vertex_clipAllPerspective3D : ogles_vertex_perspective3D;
if (enables & (GGL_ENABLE_DEPTH_TEST|GGL_ENABLE_FOG)) {
- c->arrays.perspective = (c->clipPlanes.enable) ?
- ogles_vertex_clipAllPerspective3DZ : ogles_vertex_perspective3DZ;
+ c->arrays.perspective = ogles_vertex_perspective3DZ;
+ if (c->clipPlanes.enable || (enables&GGL_ENABLE_FOG))
+ c->arrays.perspective = ogles_vertex_clipAllPerspective3DZ;
}
if ((c->arrays.vertex.size != 4) &&
(c->transforms.mvp4.flags & transform_t::FLAGS_2D_PROJECTION)) {