gpu: remove Backend.NilTexture

It serves no purpose other than paranoia. Perhaps buggy drivers exists that
require unused texture slots cleared before drawing to a texture, but if so the
workaround belongs in the GL backend.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-20 22:42:53 +01:00
parent a4ee72ed28
commit 744a962beb
3 changed files with 0 additions and 7 deletions
-1
View File
@@ -20,7 +20,6 @@ type Backend interface {
IsTimeContinuous() bool IsTimeContinuous() bool
NewTexture(format TextureFormat, width, height int, minFilter, magFilter TextureFilter) Texture NewTexture(format TextureFormat, width, height int, minFilter, magFilter TextureFilter) Texture
DefaultFramebuffer() Framebuffer DefaultFramebuffer() Framebuffer
NilTexture() Texture
NewFramebuffer() Framebuffer NewFramebuffer() Framebuffer
NewImmutableBuffer(typ BufferType, data []byte) Buffer NewImmutableBuffer(typ BufferType, data []byte) Buffer
NewBuffer(typ BufferType, size int) Buffer NewBuffer(typ BufferType, size int) Buffer
-4
View File
@@ -167,10 +167,6 @@ func (b *Backend) NewFramebuffer() gpu.Framebuffer {
return &gpuFramebuffer{funcs: b.funcs, obj: fb} return &gpuFramebuffer{funcs: b.funcs, obj: fb}
} }
func (b *Backend) NilTexture() gpu.Texture {
return &gpuTexture{backend: b}
}
func (b *Backend) DefaultFramebuffer() gpu.Framebuffer { func (b *Backend) DefaultFramebuffer() gpu.Framebuffer {
return b.defFBO return b.defFBO
} }
-2
View File
@@ -279,7 +279,6 @@ func (p *pather) stencilPath(bounds image.Rectangle, offset f32.Point, uv image.
} }
func (s *stenciler) beginIntersect(sizes []image.Point) { func (s *stenciler) beginIntersect(sizes []image.Point) {
s.ctx.NilTexture().Bind(1)
s.ctx.BlendFunc(BlendFactorDstColor, BlendFactorZero) s.ctx.BlendFunc(BlendFactorDstColor, BlendFactorZero)
// 8 bit coverage is enough, but OpenGL ES only supports single channel // 8 bit coverage is enough, but OpenGL ES only supports single channel
// floating point formats. Replace with GL_RGB+GL_UNSIGNED_BYTE if // floating point formats. Replace with GL_RGB+GL_UNSIGNED_BYTE if
@@ -304,7 +303,6 @@ func (s *stenciler) cover(idx int) stencilFBO {
} }
func (s *stenciler) begin(sizes []image.Point) { func (s *stenciler) begin(sizes []image.Point) {
s.ctx.NilTexture().Bind(1)
s.ctx.BlendFunc(BlendFactorOne, BlendFactorOne) s.ctx.BlendFunc(BlendFactorOne, BlendFactorOne)
s.fbos.resize(s.ctx, sizes) s.fbos.resize(s.ctx, sizes)
s.ctx.ClearColor(0.0, 0.0, 0.0, 0.0) s.ctx.ClearColor(0.0, 0.0, 0.0, 0.0)