internal/graphicscommand: move the const check outside of the function

old.txt: 1fe988eabf
new.txt: this commit

```
benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: github.com/hajimehoshi/ebiten/v2/internal/graphicscommand
cpu: Apple M3 Pro
                            │   old.txt   │              new.txt               │
                            │   sec/op    │   sec/op     vs base               │
PrependPreservedUniforms-12   19.79n ± 4%   18.84n ± 2%  -4.80% (p=0.001 n=10)
```

Updates #3144
This commit is contained in:
Hajime Hoshi 2024-10-26 13:02:09 +09:00
parent 1fe988eabf
commit ecc42d4042

View File

@ -465,12 +465,12 @@ func prependPreservedUniforms(uniforms []uint32, shader *Shader, dst *Image, src
uniforms[44] = 0 uniforms[44] = 0
uniforms[45] = math.Float32bits(1) uniforms[45] = math.Float32bits(1)
// Confirm the concrete value of graphics.PreservedUniformUint32Count.
var _ [0]struct{} = [graphics.PreservedUniformUint32Count - 46]struct{}{}
return uniforms return uniforms
} }
// Confirm the concrete value of graphics.PreservedUniformUint32Count.
var _ [0]struct{} = [graphics.PreservedUniformUint32Count - 46]struct{}{}
type commandQueuePool struct { type commandQueuePool struct {
cache []*commandQueue cache []*commandQueue
m sync.Mutex m sync.Mutex