mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
Implement the correct DrawTriangles definition on metal
This commit is contained in:
parent
ced0c62827
commit
8c0bc0a2e0
@ -467,7 +467,7 @@ func (g *Graphics) flushRenderCommandEncoderIfNeeded() {
|
|||||||
g.lastDst = nil
|
g.lastDst = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Graphics) draw(dst *Image, dstRegions []graphicsdriver.DstRegion, srcs [graphics.ShaderImageCount]*Image, indexOffset int, shader *Shader, uniforms [][]uint32, blend graphicsdriver.Blend, fillRule graphicsdriver.FillRule) error {
|
func (g *Graphics) draw(dst *Image, dstRegions []graphicsdriver.DstRegion, srcs [graphics.ShaderSrcImageCount]*Image, indexOffset int, shader *Shader, uniforms [][]uint32, blend graphicsdriver.Blend, fillRule graphicsdriver.FillRule) error {
|
||||||
// When preparing a stencil buffer, flush the current render command encoder
|
// When preparing a stencil buffer, flush the current render command encoder
|
||||||
// to make sure the stencil buffer is cleared when loading.
|
// to make sure the stencil buffer is cleared when loading.
|
||||||
// TODO: What about clearing the stencil buffer by vertices?
|
// TODO: What about clearing the stencil buffer by vertices?
|
||||||
@ -605,18 +605,18 @@ func (g *Graphics) draw(dst *Image, dstRegions []graphicsdriver.DstRegion, srcs
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics.ShaderImageCount]graphicsdriver.ImageID, shaderID graphicsdriver.ShaderID, dstRegions []graphicsdriver.DstRegion, indexOffset int, blend graphicsdriver.Blend, uniforms []uint32, fillRule graphicsdriver.FillRule) error {
|
func (g *Graphics) DrawTriangles(dstIDs [graphics.ShaderDstImageCount]graphicsdriver.ImageID, srcIDs [graphics.ShaderSrcImageCount]graphicsdriver.ImageID, shaderID graphicsdriver.ShaderID, dstRegions []graphicsdriver.DstRegion, indexOffset int, blend graphicsdriver.Blend, uniforms []uint32, fillRule graphicsdriver.FillRule) error {
|
||||||
if shaderID == graphicsdriver.InvalidShaderID {
|
if shaderID == graphicsdriver.InvalidShaderID {
|
||||||
return fmt.Errorf("metal: shader ID is invalid")
|
return fmt.Errorf("metal: shader ID is invalid")
|
||||||
}
|
}
|
||||||
|
|
||||||
dst := g.images[dstID]
|
dst := g.images[dstIDs[0]]
|
||||||
|
|
||||||
if dst.screen {
|
if dst.screen {
|
||||||
g.view.update()
|
g.view.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
var srcs [graphics.ShaderImageCount]*Image
|
var srcs [graphics.ShaderSrcImageCount]*Image
|
||||||
for i, srcID := range srcIDs {
|
for i, srcID := range srcIDs {
|
||||||
srcs[i] = g.images[srcID]
|
srcs[i] = g.images[srcID]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user