From c247da0f05295ba07e52eea38847d279c6910244 Mon Sep 17 00:00:00 2001 From: Zyko <13394516+Zyko0@users.noreply.github.com> Date: Sat, 6 Apr 2024 11:40:12 +0200 Subject: [PATCH] Remove useless debug + setviewport only once --- internal/graphicsdriver/opengl/graphics.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/graphicsdriver/opengl/graphics.go b/internal/graphicsdriver/opengl/graphics.go index 38a132a90..4a7c0a6d4 100644 --- a/internal/graphicsdriver/opengl/graphics.go +++ b/internal/graphicsdriver/opengl/graphics.go @@ -216,15 +216,16 @@ func (g *Graphics) DrawTriangles(dstIDs [graphics.ShaderDstImageCount]graphicsdr if dst == nil { continue } - if err := dst.setViewport(); err != nil { - return err - } destinations[i] = dst dstCount++ } if dstCount == 0 { return nil } + // Only necessary for the same shared framebuffer + if err := destinations[0].setViewport(); err != nil { + return err + } // Color attachments var attached []uint32 @@ -232,9 +233,6 @@ func (g *Graphics) DrawTriangles(dstIDs [graphics.ShaderDstImageCount]graphicsdr if dst == nil { continue } - if dstCount > 1 { - //fmt.Println("id:", dst.texture, "ok:", dst.id, "regions:", len(dstRegions)) - } attached = append(attached, uint32(gl.COLOR_ATTACHMENT0+i)) g.context.ctx.FramebufferTexture2D(gl.FRAMEBUFFER, uint32(gl.COLOR_ATTACHMENT0+i), gl.TEXTURE_2D, uint32(dst.texture), 0) }