mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/graphicsdriver/directx: refactoring
This commit is contained in:
parent
fe42c1f2b5
commit
f698f8fc69
@ -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
|
||||
|
@ -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))...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user