mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
make sure the writting mask is on for depth buffer
This commit is contained in:
parent
ac46b2bd17
commit
e32e45ed2b
2 changed files with 12 additions and 2 deletions
|
@ -1019,8 +1019,6 @@ void Application::paintGL() {
|
||||||
// Back to the default framebuffer;
|
// Back to the default framebuffer;
|
||||||
gpu::Batch batch;
|
gpu::Batch batch;
|
||||||
batch.resetStages();
|
batch.resetStages();
|
||||||
// TODO: Testing the water here, it is maybe not needed at all,
|
|
||||||
// i would like to keep it like that until we merge with DisplayPlugin
|
|
||||||
renderArgs._context->render(batch);
|
renderArgs._context->render(batch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,10 +209,17 @@ void GLBackend::do_clearFramebuffer(Batch& batch, uint32 paramOffset) {
|
||||||
int stencil = batch._params[paramOffset + 1]._int;
|
int stencil = batch._params[paramOffset + 1]._int;
|
||||||
int useScissor = batch._params[paramOffset + 0]._int;
|
int useScissor = batch._params[paramOffset + 0]._int;
|
||||||
|
|
||||||
|
bool restoreDepthMask = false;
|
||||||
GLuint glmask = 0;
|
GLuint glmask = 0;
|
||||||
if (masks & Framebuffer::BUFFER_STENCIL) {
|
if (masks & Framebuffer::BUFFER_STENCIL) {
|
||||||
glClearStencil(stencil);
|
glClearStencil(stencil);
|
||||||
glmask |= GL_STENCIL_BUFFER_BIT;
|
glmask |= GL_STENCIL_BUFFER_BIT;
|
||||||
|
|
||||||
|
bool cacheDepthMask = _pipeline._stateCache.depthTest.getWriteMask();
|
||||||
|
if (!cacheDepthMask) {
|
||||||
|
restoreDepthMask = true;
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (masks & Framebuffer::BUFFER_DEPTH) {
|
if (masks & Framebuffer::BUFFER_DEPTH) {
|
||||||
|
@ -252,6 +259,11 @@ void GLBackend::do_clearFramebuffer(Batch& batch, uint32 paramOffset) {
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// REstore write mask
|
||||||
|
if (restoreDepthMask) {
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
// Restore the color draw buffers only if a frmaebuffer is bound
|
// Restore the color draw buffers only if a frmaebuffer is bound
|
||||||
if (_output._framebuffer && !drawBuffers.empty()) {
|
if (_output._framebuffer && !drawBuffers.empty()) {
|
||||||
auto glFramebuffer = syncGPUObject(*_output._framebuffer);
|
auto glFramebuffer = syncGPUObject(*_output._framebuffer);
|
||||||
|
|
Loading…
Reference in a new issue