From 8128d6371db00f04b659e7fdefca0094296fbb91 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 15 Mar 2021 19:17:22 +0100 Subject: [PATCH] gpu: [compute] clear material texture before reusing it Otherwise the padding we leave around rendered materials may contain content from reclaimed materials. Fixes icon "shimmering" when the kitchen example is transforming. Signed-off-by: Elias Naur --- gpu/compute.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpu/compute.go b/gpu/compute.go index 291de9e5..922110d5 100644 --- a/gpu/compute.go +++ b/gpu/compute.go @@ -457,6 +457,9 @@ restart: g.ctx.BindTexture(0, g.images.tex) g.ctx.BindFramebuffer(m.fbo) g.ctx.Viewport(0, 0, texSize, texSize) + if reclaimed { + g.ctx.Clear(0, 0, 0, 0) + } g.ctx.BindProgram(m.prog) g.ctx.BindVertexBuffer(m.buffer, int(unsafe.Sizeof(m.quads[0])), 0) g.ctx.BindInputLayout(m.layout)