gpu: drop Framebuffer.IsComplete in favour of an error from NewFramebuffer

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-22 07:22:44 +01:00
parent eb7e11ee8e
commit 9c984e03b8
4 changed files with 15 additions and 22 deletions
+2 -9
View File
@@ -489,7 +489,7 @@ func (r *renderer) stencilClips(pathCache *opCache, ops []*pathOp) {
if fbo != p.place.Idx {
fbo = p.place.Idx
f := r.pather.stenciler.cover(fbo)
bindFramebuffer(f.fbo)
f.fbo.Bind()
r.ctx.Clear(BufferAttachmentColor)
}
data, _ := pathCache.get(p.pathKey)
@@ -513,7 +513,7 @@ func (r *renderer) intersect(ops []imageOp) {
if fbo != img.place.Idx {
fbo = img.place.Idx
f := r.pather.stenciler.intersections.fbos[fbo]
bindFramebuffer(f.fbo)
f.fbo.Bind()
r.ctx.Clear(BufferAttachmentColor)
}
r.ctx.Viewport(img.place.Pos.X, img.place.Pos.Y, img.clip.Dx(), img.clip.Dy())
@@ -990,13 +990,6 @@ func clipSpaceTransform(r image.Rectangle, viewport image.Point) (f32.Point, f32
return scale, offset
}
func bindFramebuffer(fbo Framebuffer) {
fbo.Bind()
if err := fbo.IsComplete(); err != nil {
panic(fmt.Errorf("AA FBO not complete: %v", err))
}
}
// Fill in maximal Y coordinates of the NW and NE corners.
func fillMaxY(verts []byte) {
contour := 0