mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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]
|
shader := g.shaders[shaderID]
|
||||||
adjustedUniforms := shader.adjustUniforms(uniforms, shader)
|
adjustedUniforms := shader.adjustUniforms(uniforms)
|
||||||
|
|
||||||
w, h := dst.internalSize()
|
w, h := dst.internalSize()
|
||||||
g.needFlushDrawCommandList = true
|
g.needFlushDrawCommandList = true
|
||||||
|
@ -157,10 +157,10 @@ func (s *Shader) pipelineState(blend graphicsdriver.Blend, stencilMode stencilMo
|
|||||||
return state, nil
|
return state, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Shader) adjustUniforms(uniforms []uint32, shader *Shader) []uint32 {
|
func (s *Shader) adjustUniforms(uniforms []uint32) []uint32 {
|
||||||
var fs []uint32
|
var fs []uint32
|
||||||
var idx int
|
var idx int
|
||||||
for i, typ := range shader.uniformTypes {
|
for i, typ := range s.uniformTypes {
|
||||||
if len(fs) < s.uniformOffsets[i]/4 {
|
if len(fs) < s.uniformOffsets[i]/4 {
|
||||||
fs = append(fs, make([]uint32, s.uniformOffsets[i]/4-len(fs))...)
|
fs = append(fs, make([]uint32, s.uniformOffsets[i]/4-len(fs))...)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user