internal/graphicsdriver/opengl: Stop using PBO

PBO was introduced to improve the performance at ReplacePixels,
but we found that PBO can degrades the performance. Also, now
multiple glTexImage2Ds are called successively like a batch, so
the situation is now different from that time when PBO was
introduced.

Let's remove PBO usages and wait and see.

Closes #1678
This commit is contained in:
Hajime Hoshi 2021-06-24 12:49:36 +09:00
parent 79220192ac
commit 2a8e8d0eb6
3 changed files with 3 additions and 2 deletions

View File

@ -449,7 +449,7 @@ func (c *context) needsRestoring() bool {
}
func (c *context) canUsePBO() bool {
return isPBOAvailable()
return false
}
func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {

View File

@ -530,7 +530,7 @@ func (c *context) needsRestoring() bool {
}
func (c *context) canUsePBO() bool {
return isWebGL2Available
return false
}
func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {

View File

@ -120,6 +120,7 @@ func (i *Image) ReplacePixels(args []*driver.ReplacePixelsArgs) {
}
i.graphics.drawCalled = false
// TODO: Now canUsePBO always returns false (#1678). Remove the code for PBO.
if !i.graphics.context.canUsePBO() {
i.graphics.context.texSubImage2D(i.textureNative, args)
return