graphicsdriver/metal: Bug fix: Some tests failed due to wrong source size

This commit is contained in:
Hajime Hoshi 2019-02-14 11:06:30 +09:00
parent 7a76a5b42d
commit a1b1bce43a

View File

@ -581,10 +581,10 @@ func (d *Driver) Draw(indexLen int, indexOffset int, mode graphics.CompositeMode
rce.SetVertexBytes(unsafe.Pointer(&viewportSize[0]), unsafe.Sizeof(viewportSize), 1) rce.SetVertexBytes(unsafe.Pointer(&viewportSize[0]), unsafe.Sizeof(viewportSize), 1)
sourceSize := [...]float32{float32(1), float32(1)} sourceSize := [...]float32{float32(1), float32(1)}
for sourceSize[0] < float32(w) { for sourceSize[0] < float32(d.src.width) {
sourceSize[0] *= 2 sourceSize[0] *= 2
} }
for sourceSize[1] < float32(h) { for sourceSize[1] < float32(d.src.height) {
sourceSize[1] *= 2 sourceSize[1] *= 2
} }
rce.SetFragmentBytes(unsafe.Pointer(&sourceSize[0]), unsafe.Sizeof(sourceSize), 2) rce.SetFragmentBytes(unsafe.Pointer(&sourceSize[0]), unsafe.Sizeof(sourceSize), 2)