Clear mips/slices in overlay on GL to avoid undefined contents

This commit is contained in:
baldurk
2020-03-19 11:34:20 +00:00
parent 7b8eeaa8c4
commit f8a6cbb0c7
2 changed files with 32 additions and 0 deletions
+12
View File
@@ -192,6 +192,18 @@ void main()
GLuint subfbo = MakeFBO();
glBindFramebuffer(GL_FRAMEBUFFER, subfbo);
// clear all mips/slices first
GLfloat black[4] = {};
for(GLint s = 0; s < 5; s++)
{
for(GLint m = 0; m < 4; m++)
{
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, subtex, m, s);
glClearBufferfv(GL_COLOR, 0, black);
}
}
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, subtex, 2, 2);
while(Running())