mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Revert "internal/restorable: integrate Shader.Dispose into internal/atlas"
This reverts commit bfa2c460a2
.
Updates #3083
This commit is contained in:
parent
17a5488c49
commit
19d2009a5f
@ -70,8 +70,7 @@ func (s *Shader) deallocate() {
|
||||
if s.shader == nil {
|
||||
return
|
||||
}
|
||||
s.shader.Shader.Dispose()
|
||||
s.shader.Shader = nil
|
||||
s.shader.Dispose()
|
||||
s.shader = nil
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ func clearImage(i *graphicscommand.Image, region image.Rectangle) {
|
||||
vs := make([]float32, 4*graphics.VertexFloatCount)
|
||||
graphics.QuadVerticesFromDstAndSrc(vs, float32(region.Min.X), float32(region.Min.Y), float32(region.Max.X), float32(region.Max.Y), 0, 0, 0, 0, 0, 0, 0, 0)
|
||||
is := graphics.QuadIndices()
|
||||
i.DrawTriangles([graphics.ShaderSrcImageCount]*graphicscommand.Image{}, vs, is, graphicsdriver.BlendClear, region, [graphics.ShaderSrcImageCount]image.Rectangle{}, clearShader.Shader, nil, graphicsdriver.FillRuleFillAll)
|
||||
i.DrawTriangles([graphics.ShaderSrcImageCount]*graphicscommand.Image{}, vs, is, graphicsdriver.BlendClear, region, [graphics.ShaderSrcImageCount]image.Rectangle{}, clearShader.shader, nil, graphicsdriver.FillRuleFillAll)
|
||||
}
|
||||
|
||||
// ClearPixels clears the specified region by WritePixels.
|
||||
@ -133,5 +133,5 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderSrcImageCount]*Image, vertice
|
||||
}
|
||||
imgs[i] = src.Image
|
||||
}
|
||||
i.Image.DrawTriangles(imgs, vertices, indices, blend, dstRegion, srcRegions, shader.Shader, uniforms, fillRule)
|
||||
i.Image.DrawTriangles(imgs, vertices, indices, blend, dstRegion, srcRegions, shader.shader, uniforms, fillRule)
|
||||
}
|
||||
|
@ -26,16 +26,21 @@ import (
|
||||
)
|
||||
|
||||
type Shader struct {
|
||||
Shader *graphicscommand.Shader
|
||||
shader *graphicscommand.Shader
|
||||
}
|
||||
|
||||
func NewShader(ir *shaderir.Program) *Shader {
|
||||
s := &Shader{
|
||||
Shader: graphicscommand.NewShader(ir),
|
||||
shader: graphicscommand.NewShader(ir),
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Shader) Dispose() {
|
||||
s.shader.Dispose()
|
||||
s.shader = nil
|
||||
}
|
||||
|
||||
var (
|
||||
NearestFilterShader *Shader
|
||||
NearestFilterShaderIR *shaderir.Program
|
||||
|
Loading…
Reference in New Issue
Block a user