gpu/backend: remove clear color and depth state

Specifying the clear color and depth at the time of clearing is
less error prone and a better for modern GPU APIs. As a bonus, we
can get rid of the BufferAttachment type.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-03-15 12:20:19 +01:00
parent daecdcaabf
commit 7fba3bb8fe
7 changed files with 24 additions and 53 deletions
-2
View File
@@ -292,7 +292,6 @@ func (s *stenciler) beginIntersect(sizes []image.Point) {
// floating point formats. Replace with GL_RGB+GL_UNSIGNED_BYTE if
// no floating point support is available.
s.intersections.resize(s.ctx, sizes)
s.ctx.ClearColor(1.0, 0.0, 0.0, 0.0)
s.ctx.BindProgram(s.iprog.prog.prog)
}
@@ -308,7 +307,6 @@ func (s *stenciler) cover(idx int) stencilFBO {
func (s *stenciler) begin(sizes []image.Point) {
s.ctx.BlendFunc(backend.BlendFactorOne, backend.BlendFactorOne)
s.fbos.resize(s.ctx, sizes)
s.ctx.ClearColor(0.0, 0.0, 0.0, 0.0)
s.ctx.BindProgram(s.prog.prog.prog)
s.ctx.BindInputLayout(s.prog.layout)
s.ctx.BindIndexBuffer(s.indexBuf)