|
|
|
@ -614,17 +614,16 @@ public class GLRenderer implements Renderer { |
|
|
|
|
|
|
|
|
|
if (state.isDepthTest() && !context.depthTestEnabled) { |
|
|
|
|
gl.glEnable(GL.GL_DEPTH_TEST); |
|
|
|
|
gl.glDepthFunc(convertTestFunction(context.depthFunc)); |
|
|
|
|
context.depthTestEnabled = true; |
|
|
|
|
} else if (!state.isDepthTest() && context.depthTestEnabled) { |
|
|
|
|
gl.glDisable(GL.GL_DEPTH_TEST); |
|
|
|
|
context.depthTestEnabled = false; |
|
|
|
|
} |
|
|
|
|
if (state.getDepthFunc() != context.depthFunc) { |
|
|
|
|
if (state.isDepthTest() && state.getDepthFunc() != context.depthFunc) { |
|
|
|
|
gl.glDepthFunc(convertTestFunction(state.getDepthFunc())); |
|
|
|
|
context.depthFunc = state.getDepthFunc(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (state.isDepthWrite() && !context.depthWriteEnabled) { |
|
|
|
|
gl.glDepthMask(true); |
|
|
|
|
context.depthWriteEnabled = true; |
|
|
|
|