internal/graphicsdriver/directx: refactoring

This commit is contained in:
Hajime Hoshi 2023-03-28 02:32:01 +09:00
parent fe42c1f2b5
commit f698f8fc69
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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))...)
}