From 35a5c88901dbc92b9360a8b8f418c48bfe0b0cb5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 12 Mar 2022 04:01:48 +0900 Subject: [PATCH] internal/graphics: rename constants --- internal/graphics/vertex.go | 4 ++-- internal/graphicsdriver/metal/graphics_darwin.go | 4 ++-- internal/graphicsdriver/opengl/graphics.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/graphics/vertex.go b/internal/graphics/vertex.go index defb980d8..efd495414 100644 --- a/internal/graphics/vertex.go +++ b/internal/graphics/vertex.go @@ -31,8 +31,8 @@ const ( 1 + // the texture source region's origin 1 // the texture source region's size - DestinationTextureSizeUniformVariableIndex = 0 - TextureSizesUniformVariableIndex = 1 + TextureDestinationSizeUniformVariableIndex = 0 + TextureSourceSizesUniformVariableIndex = 1 TextureDestinationRegionOriginUniformVariableIndex = 2 TextureDestinationRegionSizeUniformVariableIndex = 3 TextureSourceOffsetsUniformVariableIndex = 4 diff --git a/internal/graphicsdriver/metal/graphics_darwin.go b/internal/graphicsdriver/metal/graphics_darwin.go index 39a7a4681..a36a36d6e 100644 --- a/internal/graphicsdriver/metal/graphics_darwin.go +++ b/internal/graphicsdriver/metal/graphics_darwin.go @@ -963,7 +963,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics. // Set the destination texture size. dw, dh := dst.internalSize() - uniformVars[graphics.DestinationTextureSizeUniformVariableIndex] = graphicsdriver.Uniform{ + uniformVars[graphics.TextureDestinationSizeUniformVariableIndex] = graphicsdriver.Uniform{ Float32s: []float32{float32(dw), float32(dh)}, } @@ -976,7 +976,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics. usizes[2*i+1] = float32(h) } } - uniformVars[graphics.TextureSizesUniformVariableIndex] = graphicsdriver.Uniform{ + uniformVars[graphics.TextureSourceSizesUniformVariableIndex] = graphicsdriver.Uniform{ Float32s: usizes, } diff --git a/internal/graphicsdriver/opengl/graphics.go b/internal/graphicsdriver/opengl/graphics.go index 593d50264..9b988de9a 100644 --- a/internal/graphicsdriver/opengl/graphics.go +++ b/internal/graphicsdriver/opengl/graphics.go @@ -268,7 +268,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics. } { - const idx = graphics.DestinationTextureSizeUniformVariableIndex + const idx = graphics.TextureDestinationSizeUniformVariableIndex w, h := destination.framebufferSize() g.uniformVars[idx].name = g.uniformVariableName(idx) g.uniformVars[idx].value.Float32s = []float32{float32(w), float32(h)} @@ -284,7 +284,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics. } } - const idx = graphics.TextureSizesUniformVariableIndex + const idx = graphics.TextureSourceSizesUniformVariableIndex g.uniformVars[idx].name = g.uniformVariableName(idx) g.uniformVars[idx].value.Float32s = sizes g.uniformVars[idx].typ = shader.ir.Uniforms[idx]