graphicscommand: Bug fix: Needed to adjust vertices when highp is not available

Fixes #962
This commit is contained in:
Hajime Hoshi 2019-10-19 16:28:53 +09:00
parent 15dc4bc647
commit e578b0bd49

View File

@ -230,6 +230,19 @@ func (q *commandQueue) Flush() {
vs[i*graphics.VertexFloatNum+6] -= 1.0 / s.width * texelAdjustmentFactor
vs[i*graphics.VertexFloatNum+7] -= 1.0 / s.height * texelAdjustmentFactor
}
} else {
n := q.nvertices / graphics.VertexFloatNum
for i := 0; i < n; i++ {
s := q.srcSizes[i]
// Convert pixels to texels.
vs[i*graphics.VertexFloatNum+2] /= s.width
vs[i*graphics.VertexFloatNum+3] /= s.height
vs[i*graphics.VertexFloatNum+4] /= s.width
vs[i*graphics.VertexFloatNum+5] /= s.height
vs[i*graphics.VertexFloatNum+6] /= s.width
vs[i*graphics.VertexFloatNum+7] /= s.height
}
}
theGraphicsDriver.Begin()