mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
graphicsdriver/opengl: Bug fix: source_size can be optimized out with nearest filter
This commit is contained in:
parent
b1b8d0b4b1
commit
1f46299870
@ -323,10 +323,15 @@ func (d *Driver) useProgram(mode graphics.CompositeMode, colorM *affine.ColorM,
|
||||
sw := graphics.InternalImageSize(srcW)
|
||||
sh := graphics.InternalImageSize(srcH)
|
||||
|
||||
if d.state.lastSourceWidth != sw || d.state.lastSourceHeight != sh {
|
||||
d.context.uniformFloats(program, "source_size", []float32{float32(sw), float32(sh)})
|
||||
d.state.lastSourceWidth = sw
|
||||
d.state.lastSourceHeight = sh
|
||||
if filter == graphics.FilterNearest {
|
||||
d.state.lastSourceWidth = 0
|
||||
d.state.lastSourceHeight = 0
|
||||
} else {
|
||||
if d.state.lastSourceWidth != sw || d.state.lastSourceHeight != sh {
|
||||
d.context.uniformFloats(program, "source_size", []float32{float32(sw), float32(sh)})
|
||||
d.state.lastSourceWidth = sw
|
||||
d.state.lastSourceHeight = sh
|
||||
}
|
||||
}
|
||||
|
||||
if filter == graphics.FilterScreen {
|
||||
|
Loading…
Reference in New Issue
Block a user