diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index dfaf120b7..4921e2d2a 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -304,11 +304,6 @@ func (c *drawTrianglesCommand) String() string { dst += " (screen)" } - shader := "default shader" - if c.shader != nil { - shader = "custom shader" - } - var srcstrs [graphics.ShaderImageCount]string for i, src := range c.srcs { if src == nil { @@ -323,7 +318,7 @@ func (c *drawTrianglesCommand) String() string { r := fmt.Sprintf("(x:%d, y:%d, width:%d, height:%d)", int(c.dstRegion.X), int(c.dstRegion.Y), int(c.dstRegion.Width), int(c.dstRegion.Height)) - return fmt.Sprintf("draw-triangles: dst: %s <- src: [%s], %s, dst region: %s, num of indices: %d, mode: %s, even-odd: %t", dst, strings.Join(srcstrs[:], ", "), shader, r, c.nindices, mode, c.evenOdd) + return fmt.Sprintf("draw-triangles: dst: %s <- src: [%s], dst region: %s, num of indices: %d, mode: %s, even-odd: %t", dst, strings.Join(srcstrs[:], ", "), r, c.nindices, mode, c.evenOdd) } // Exec executes the drawTrianglesCommand. diff --git a/internal/mipmap/mipmap.go b/internal/mipmap/mipmap.go index 6d1bcd742..07422a09e 100644 --- a/internal/mipmap/mipmap.go +++ b/internal/mipmap/mipmap.go @@ -104,11 +104,6 @@ func (m *Mipmap) DrawTriangles(srcs [graphics.ShaderImageCount]*Mipmap, vertices } } - var s *buffered.Shader - if shader != nil { - s = shader.shader - } - var imgs [graphics.ShaderImageCount]*buffered.Image for i, src := range srcs { if src == nil { @@ -129,7 +124,7 @@ func (m *Mipmap) DrawTriangles(srcs [graphics.ShaderImageCount]*Mipmap, vertices imgs[i] = src.orig } - m.orig.DrawTriangles(imgs, vertices, indices, colorm, mode, filter, address, dstRegion, srcRegion, subimageOffsets, s, uniforms, evenOdd) + m.orig.DrawTriangles(imgs, vertices, indices, colorm, mode, filter, address, dstRegion, srcRegion, subimageOffsets, shader.shader, uniforms, evenOdd) m.disposeMipmaps() } diff --git a/internal/restorable/image.go b/internal/restorable/image.go index 153009f6d..bac28fadd 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -603,11 +603,6 @@ func (i *Image) restore(graphicsDriver graphicsdriver.Graphics) error { i.basePixels.Apply(gimg) for _, c := range i.drawTrianglesHistory { - var s *graphicscommand.Shader - if c.shader != nil { - s = c.shader.shader - } - var imgs [graphics.ShaderImageCount]*graphicscommand.Image for i, img := range c.images { if img == nil { @@ -618,7 +613,7 @@ func (i *Image) restore(graphicsDriver graphicsdriver.Graphics) error { } imgs[i] = img.image } - gimg.DrawTriangles(imgs, c.offsets, c.vertices, c.indices, c.mode, c.dstRegion, c.srcRegion, s, c.uniforms, c.evenOdd) + gimg.DrawTriangles(imgs, c.offsets, c.vertices, c.indices, c.mode, c.dstRegion, c.srcRegion, c.shader.shader, c.uniforms, c.evenOdd) } if len(i.drawTrianglesHistory) > 0 { diff --git a/internal/ui/image.go b/internal/ui/image.go index a6d713b36..953d0a331 100644 --- a/internal/ui/image.go +++ b/internal/ui/image.go @@ -69,12 +69,7 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageCount]*Image, vertices [ srcMipmaps[i] = src.mipmap } - var s *mipmap.Shader - if shader != nil { - s = shader.shader - } - - i.mipmap.DrawTriangles(srcMipmaps, vertices, indices, colorm, mode, filter, address, dstRegion, srcRegion, subimageOffsets, s, uniforms, evenOdd, canSkipMipmap) + i.mipmap.DrawTriangles(srcMipmaps, vertices, indices, colorm, mode, filter, address, dstRegion, srcRegion, subimageOffsets, shader.shader, uniforms, evenOdd, canSkipMipmap) } func (i *Image) WritePixels(pix []byte, x, y, width, height int) {