From 6fc9d9316d923dfbee77065e701ecfbdddff150f Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 2 Oct 2022 22:11:06 +0900 Subject: [PATCH] internal/graphicscommand: remove unnecessary conditions Now a Kage shader is always used. --- internal/graphicscommand/command.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 14af4731d..23c56a3f4 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -402,19 +402,17 @@ func (c *drawTrianglesCommand) CanMergeWithDrawTrianglesCommand(dst *Image, srcs if c.shader != shader { return false } - if c.shader != nil { - if len(c.uniforms) != len(uniforms) { + if len(c.uniforms) != len(uniforms) { + return false + } + for i := range c.uniforms { + if len(c.uniforms[i]) != len(uniforms[i]) { return false } - for i := range c.uniforms { - if len(c.uniforms[i]) != len(uniforms[i]) { + for j := range c.uniforms[i] { + if c.uniforms[i][j] != uniforms[i][j] { return false } - for j := range c.uniforms[i] { - if c.uniforms[i][j] != uniforms[i][j] { - return false - } - } } } if c.dst != dst {