Skip to content

Commit

Permalink
internal/graphicscommand: move the const check outside of the function
Browse files Browse the repository at this point in the history
old.txt: 1fe988e
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
  • Loading branch information
hajimehoshi committed Oct 26, 2024
1 parent 1fe988e commit ecc42d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/graphicscommand/commandqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@ func prependPreservedUniforms(uniforms []uint32, shader *Shader, dst *Image, src
uniforms[44] = 0
uniforms[45] = math.Float32bits(1)

// Confirm the concrete value of graphics.PreservedUniformUint32Count.
var _ [0]struct{} = [graphics.PreservedUniformUint32Count - 46]struct{}{}

return uniforms
}

// Confirm the concrete value of graphics.PreservedUniformUint32Count.
var _ [0]struct{} = [graphics.PreservedUniformUint32Count - 46]struct{}{}

type commandQueuePool struct {
cache []*commandQueue
m sync.Mutex
Expand Down

0 comments on commit ecc42d4

Please sign in to comment.