From f698f8fc697670b9501df7062cfc2b84a9a3d4d1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 28 Mar 2023 02:32:01 +0900 Subject: [PATCH] internal/graphicsdriver/directx: refactoring --- internal/graphicsdriver/directx/graphics12_windows.go | 2 +- internal/graphicsdriver/directx/shader_windows.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/graphicsdriver/directx/graphics12_windows.go b/internal/graphicsdriver/directx/graphics12_windows.go index 114119b2b..c814ee9c8 100644 --- a/internal/graphicsdriver/directx/graphics12_windows.go +++ b/internal/graphicsdriver/directx/graphics12_windows.go @@ -1133,7 +1133,7 @@ func (g *graphics12) DrawTriangles(dstID graphicsdriver.ImageID, srcs [graphics. } shader := g.shaders[shaderID] - adjustedUniforms := shader.adjustUniforms(uniforms, shader) + adjustedUniforms := shader.adjustUniforms(uniforms) w, h := dst.internalSize() g.needFlushDrawCommandList = true diff --git a/internal/graphicsdriver/directx/shader_windows.go b/internal/graphicsdriver/directx/shader_windows.go index 6b0486468..2a18c8427 100644 --- a/internal/graphicsdriver/directx/shader_windows.go +++ b/internal/graphicsdriver/directx/shader_windows.go @@ -157,10 +157,10 @@ func (s *Shader) pipelineState(blend graphicsdriver.Blend, stencilMode stencilMo return state, nil } -func (s *Shader) adjustUniforms(uniforms []uint32, shader *Shader) []uint32 { +func (s *Shader) adjustUniforms(uniforms []uint32) []uint32 { var fs []uint32 var idx int - for i, typ := range shader.uniformTypes { + for i, typ := range s.uniformTypes { if len(fs) < s.uniformOffsets[i]/4 { fs = append(fs, make([]uint32, s.uniformOffsets[i]/4-len(fs))...) }