From ecc42d4042228987fbd006605c38a6193aa71cff Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 26 Oct 2024 13:02:09 +0900 Subject: [PATCH] internal/graphicscommand: move the const check outside of the function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit old.txt: 1fe988eabf4b56490fbd0bd8c6a0359036931f37 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 --- internal/graphicscommand/commandqueue.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/graphicscommand/commandqueue.go b/internal/graphicscommand/commandqueue.go index 8048dff65..2e30dd1cd 100644 --- a/internal/graphicscommand/commandqueue.go +++ b/internal/graphicscommand/commandqueue.go @@ -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