gpu,gpu/internal: drop implied transformation from BlitFramebuffer

The Metal (and presumably the D3D11) backend doesn't support transformed
framebuffer blits. The only caller doesn't need it either, so drop that
capability from the driver abstraction.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-08-18 13:48:55 +02:00
parent 58cc817e5f
commit 07fdc1a2de
4 changed files with 5 additions and 5 deletions
+1 -2
View File
@@ -695,8 +695,7 @@ func (g *compute) compactLayers() error {
dst := atlas.fbo
sz := l.rect.Size()
sr := image.Rectangle{Min: l.place.pos, Max: l.place.pos.Add(sz)}
dr := image.Rectangle{Min: l.newPlace.pos, Max: l.newPlace.pos.Add(sz)}
g.ctx.BlitFramebuffer(dst, src, sr, dr)
g.ctx.BlitFramebuffer(dst, src, sr, l.newPlace.pos)
l.place.atlas.layers--
layers[i].place = l.newPlace
}
+1 -1
View File
@@ -165,7 +165,7 @@ func (b *Backend) BeginFrame(target driver.RenderTarget, clear bool, viewport im
return &Framebuffer{ctx: b.ctx, dev: b.dev, renderTarget: renderTarget, foreign: true}
}
func (b *Backend) BlitFramebuffer(dst, src driver.Framebuffer, srect, drect image.Rectangle) {
func (b *Backend) BlitFramebuffer(dst, src driver.Framebuffer, srect image.Rectangle, dorigin image.Point) {
panic("not implemented")
}
+1 -1
View File
@@ -45,7 +45,7 @@ type Device interface {
BindFragmentUniforms(buf Buffer)
BindStorageBuffer(binding int, buf Buffer)
BlitFramebuffer(dst, src Framebuffer, srect, drect image.Rectangle)
BlitFramebuffer(dst, src Framebuffer, srcRect image.Rectangle, dstOrigin image.Point)
MemoryBarrier()
DispatchCompute(x, y, z int)
+2 -1
View File
@@ -1166,9 +1166,10 @@ func (b *Backend) BindIndexBuffer(buf driver.Buffer) {
b.glstate.bindBuffer(b.funcs, gl.ELEMENT_ARRAY_BUFFER, gbuf.obj)
}
func (b *Backend) BlitFramebuffer(dst, src driver.Framebuffer, srect, drect image.Rectangle) {
func (b *Backend) BlitFramebuffer(dst, src driver.Framebuffer, srect image.Rectangle, dorig image.Point) {
b.glstate.bindFramebuffer(b.funcs, gl.DRAW_FRAMEBUFFER, dst.(*framebuffer).obj)
b.glstate.bindFramebuffer(b.funcs, gl.READ_FRAMEBUFFER, src.(*framebuffer).obj)
drect := image.Rectangle{Min: dorig, Max: dorig.Add(srect.Size())}
b.funcs.BlitFramebuffer(
srect.Min.X, srect.Min.Y, srect.Max.X, srect.Max.Y,
drect.Min.X, drect.Min.Y, drect.Max.X, drect.Max.Y,