mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:18:24 +02:00
clear empty frame buffer fix
thanks sam!
This commit is contained in:
parent
883aa7af8d
commit
4e3cfd7c49
1 changed files with 13 additions and 6 deletions
|
@ -231,6 +231,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, uint32 paramOffset) {
|
||||||
|
|
||||||
std::vector<GLenum> drawBuffers;
|
std::vector<GLenum> drawBuffers;
|
||||||
if (masks & Framebuffer::BUFFER_COLORS) {
|
if (masks & Framebuffer::BUFFER_COLORS) {
|
||||||
|
if (_output._framebuffer) {
|
||||||
for (unsigned int i = 0; i < Framebuffer::MAX_NUM_RENDER_BUFFERS; i++) {
|
for (unsigned int i = 0; i < Framebuffer::MAX_NUM_RENDER_BUFFERS; i++) {
|
||||||
if (masks & (1 << i)) {
|
if (masks & (1 << i)) {
|
||||||
drawBuffers.push_back(GL_COLOR_ATTACHMENT0 + i);
|
drawBuffers.push_back(GL_COLOR_ATTACHMENT0 + i);
|
||||||
|
@ -241,6 +242,12 @@ void GLBackend::do_clearFramebuffer(Batch& batch, uint32 paramOffset) {
|
||||||
glDrawBuffers(drawBuffers.size(), drawBuffers.data());
|
glDrawBuffers(drawBuffers.size(), drawBuffers.data());
|
||||||
glClearColor(color.x, color.y, color.z, color.w);
|
glClearColor(color.x, color.y, color.z, color.w);
|
||||||
glmask |= GL_COLOR_BUFFER_BIT;
|
glmask |= GL_COLOR_BUFFER_BIT;
|
||||||
|
|
||||||
|
(void) CHECK_GL_ERROR();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
glClearColor(color.x, color.y, color.z, color.w);
|
||||||
|
glmask |= GL_COLOR_BUFFER_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force the color mask cache to WRITE_ALL if not the case
|
// Force the color mask cache to WRITE_ALL if not the case
|
||||||
|
|
Loading…
Reference in a new issue