internal/graphics: rename constants

This commit is contained in:
Hajime Hoshi 2022-03-12 04:01:48 +09:00
parent 98e2d86ea3
commit 35a5c88901
3 changed files with 6 additions and 6 deletions

View File

@ -31,8 +31,8 @@ const (
1 + // the texture source region's origin 1 + // the texture source region's origin
1 // the texture source region's size 1 // the texture source region's size
DestinationTextureSizeUniformVariableIndex = 0 TextureDestinationSizeUniformVariableIndex = 0
TextureSizesUniformVariableIndex = 1 TextureSourceSizesUniformVariableIndex = 1
TextureDestinationRegionOriginUniformVariableIndex = 2 TextureDestinationRegionOriginUniformVariableIndex = 2
TextureDestinationRegionSizeUniformVariableIndex = 3 TextureDestinationRegionSizeUniformVariableIndex = 3
TextureSourceOffsetsUniformVariableIndex = 4 TextureSourceOffsetsUniformVariableIndex = 4

View File

@ -963,7 +963,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics.
// Set the destination texture size. // Set the destination texture size.
dw, dh := dst.internalSize() dw, dh := dst.internalSize()
uniformVars[graphics.DestinationTextureSizeUniformVariableIndex] = graphicsdriver.Uniform{ uniformVars[graphics.TextureDestinationSizeUniformVariableIndex] = graphicsdriver.Uniform{
Float32s: []float32{float32(dw), float32(dh)}, 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) usizes[2*i+1] = float32(h)
} }
} }
uniformVars[graphics.TextureSizesUniformVariableIndex] = graphicsdriver.Uniform{ uniformVars[graphics.TextureSourceSizesUniformVariableIndex] = graphicsdriver.Uniform{
Float32s: usizes, Float32s: usizes,
} }

View File

@ -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() w, h := destination.framebufferSize()
g.uniformVars[idx].name = g.uniformVariableName(idx) g.uniformVars[idx].name = g.uniformVariableName(idx)
g.uniformVars[idx].value.Float32s = []float32{float32(w), float32(h)} 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].name = g.uniformVariableName(idx)
g.uniformVars[idx].value.Float32s = sizes g.uniformVars[idx].value.Float32s = sizes
g.uniformVars[idx].typ = shader.ir.Uniforms[idx] g.uniformVars[idx].typ = shader.ir.Uniforms[idx]