From e578b0bd49bce88ed8b558d7043aad978de61539 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 19 Oct 2019 16:28:53 +0900 Subject: [PATCH] graphicscommand: Bug fix: Needed to adjust vertices when highp is not available Fixes #962 --- internal/graphicscommand/command.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 2db7a1234..b3c82609e 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -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()