Remove useless debug + setviewport only once

This commit is contained in:
Zyko 2024-04-06 11:40:12 +02:00
parent 9003692630
commit c247da0f05

View File

@ -216,15 +216,16 @@ func (g *Graphics) DrawTriangles(dstIDs [graphics.ShaderDstImageCount]graphicsdr
if dst == nil { if dst == nil {
continue continue
} }
if err := dst.setViewport(); err != nil {
return err
}
destinations[i] = dst destinations[i] = dst
dstCount++ dstCount++
} }
if dstCount == 0 { if dstCount == 0 {
return nil return nil
} }
// Only necessary for the same shared framebuffer
if err := destinations[0].setViewport(); err != nil {
return err
}
// Color attachments // Color attachments
var attached []uint32 var attached []uint32
@ -232,9 +233,6 @@ func (g *Graphics) DrawTriangles(dstIDs [graphics.ShaderDstImageCount]graphicsdr
if dst == nil { if dst == nil {
continue continue
} }
if dstCount > 1 {
//fmt.Println("id:", dst.texture, "ok:", dst.id, "regions:", len(dstRegions))
}
attached = append(attached, uint32(gl.COLOR_ATTACHMENT0+i)) 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) g.context.ctx.FramebufferTexture2D(gl.FRAMEBUFFER, uint32(gl.COLOR_ATTACHMENT0+i), gl.TEXTURE_2D, uint32(dst.texture), 0)
} }