internal/graphicsdriver/opengl: Refactoring: Remove unused arguments from texSubImage2D

This commit is contained in:
Hajime Hoshi 2021-06-24 12:06:28 +09:00
parent fa8e271f2a
commit 7f60cd41eb
4 changed files with 5 additions and 5 deletions

View File

@ -452,7 +452,7 @@ func (c *context) canUsePBO() bool {
return isPBOAvailable() return isPBOAvailable()
} }
func (c *context) texSubImage2D(t textureNative, width, height int, args []*driver.ReplacePixelsArgs) { func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {
c.bindTexture(t) c.bindTexture(t)
for _, a := range args { for _, a := range args {
gl.TexSubImage2D(gl.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(a.Pixels)) gl.TexSubImage2D(gl.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(a.Pixels))

View File

@ -533,7 +533,7 @@ func (c *context) canUsePBO() bool {
return isWebGL2Available return isWebGL2Available
} }
func (c *context) texSubImage2D(t textureNative, width, height int, args []*driver.ReplacePixelsArgs) { func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {
c.bindTexture(t) c.bindTexture(t)
gl := c.gl gl := c.gl
for _, a := range args { for _, a := range args {

View File

@ -419,7 +419,7 @@ func (c *context) canUsePBO() bool {
return false return false
} }
func (c *context) texSubImage2D(t textureNative, width, height int, args []*driver.ReplacePixelsArgs) { func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {
c.bindTexture(t) c.bindTexture(t)
for _, a := range args { for _, a := range args {
c.ctx.TexSubImage2D(gles.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gles.RGBA, gles.UNSIGNED_BYTE, a.Pixels) c.ctx.TexSubImage2D(gles.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gles.RGBA, gles.UNSIGNED_BYTE, a.Pixels)

View File

@ -120,12 +120,12 @@ func (i *Image) ReplacePixels(args []*driver.ReplacePixelsArgs) {
} }
i.graphics.drawCalled = false i.graphics.drawCalled = false
w, h := i.width, i.height
if !i.graphics.context.canUsePBO() { if !i.graphics.context.canUsePBO() {
i.graphics.context.texSubImage2D(i.textureNative, w, h, args) i.graphics.context.texSubImage2D(i.textureNative, args)
return return
} }
w, h := i.width, i.height
if i.pbo.equal(*new(buffer)) { if i.pbo.equal(*new(buffer)) {
i.pbo = i.graphics.context.newPixelBufferObject(w, h) i.pbo = i.graphics.context.newPixelBufferObject(w, h)
if i.pbo.equal(*new(buffer)) { if i.pbo.equal(*new(buffer)) {