mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user