diff --git a/internal/graphicsdriver/directx/graphics_windows.go b/internal/graphicsdriver/directx/graphics_windows.go index 68bef475c..97460fed7 100644 --- a/internal/graphicsdriver/directx/graphics_windows.go +++ b/internal/graphicsdriver/directx/graphics_windows.go @@ -1224,10 +1224,10 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcs [graphics.Sh // match. Then, the Y direction must be inverted. const idx = graphics.ProjectionMatrixUniformVariableIndex // Invert the sign bits as float32 values. - uniforms[idx][1] = uniforms[idx][1] ^ (1 << 31) - uniforms[idx][5] = uniforms[idx][5] ^ (1 << 31) - uniforms[idx][9] = uniforms[idx][9] ^ (1 << 31) - uniforms[idx][13] = uniforms[idx][13] ^ (1 << 31) + uniforms[idx][1] ^= 1 << 31 + uniforms[idx][5] ^= 1 << 31 + uniforms[idx][9] ^= 1 << 31 + uniforms[idx][13] ^= 1 << 31 flattenUniforms := shader.flattenUniforms(uniforms) diff --git a/internal/graphicsdriver/metal/graphics_darwin.go b/internal/graphicsdriver/metal/graphics_darwin.go index 7032c97e9..d2dfaa5e8 100644 --- a/internal/graphicsdriver/metal/graphics_darwin.go +++ b/internal/graphicsdriver/metal/graphics_darwin.go @@ -568,10 +568,10 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics. // In Metal, the NDC's Y direction (upward) and the framebuffer's Y direction (downward) don't // match. Then, the Y direction must be inverted. // Invert the sign bits as float32 values. - v[1] = v[1] ^ (1 << 31) - v[5] = v[5] ^ (1 << 31) - v[9] = v[9] ^ (1 << 31) - v[13] = v[13] ^ (1 << 31) + v[1] ^= 1 << 31 + v[5] ^= 1 << 31 + v[9] ^= 1 << 31 + v[13] ^= 1 << 31 } t := g.shaders[shaderID].ir.Uniforms[i] diff --git a/internal/graphicsdriver/opengl/graphics.go b/internal/graphicsdriver/opengl/graphics.go index 72312d62d..da2bc89c0 100644 --- a/internal/graphicsdriver/opengl/graphics.go +++ b/internal/graphicsdriver/opengl/graphics.go @@ -214,10 +214,10 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics. if destination.screen { const idx = graphics.ProjectionMatrixUniformVariableIndex // Invert the sign bits as float32 values. - g.uniformVars[idx].value[1] = g.uniformVars[idx].value[1] ^ (1 << 31) - g.uniformVars[idx].value[5] = g.uniformVars[idx].value[5] ^ (1 << 31) - g.uniformVars[idx].value[9] = g.uniformVars[idx].value[9] ^ (1 << 31) - g.uniformVars[idx].value[13] = g.uniformVars[idx].value[13] ^ (1 << 31) + g.uniformVars[idx].value[1] ^= 1 << 31 + g.uniformVars[idx].value[5] ^= 1 << 31 + g.uniformVars[idx].value[9] ^= 1 << 31 + g.uniformVars[idx].value[13] ^= 1 << 31 } var imgs [graphics.ShaderImageCount]textureVariable