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
+1 -9
View File
@@ -27,9 +27,8 @@ type Device interface {
NewInputLayout(vertexShader ShaderSources, layout []InputDesc) (InputLayout, error)
DepthFunc(f DepthFunc)
ClearColor(r, g, b, a float32)
ClearDepth(d float32)
Clear(buffers BufferAttachments)
Clear(r, g, b, a float32)
Viewport(x, y, width, height int)
DrawArrays(mode DrawMode, off, count int)
DrawElements(mode DrawMode, off, count int)
@@ -110,8 +109,6 @@ type BlendFactor uint8
type DrawMode uint8
type BufferAttachments uint
type TextureFilter uint8
type TextureFormat uint8
@@ -157,11 +154,6 @@ type Texture interface {
Release()
}
const (
BufferAttachmentColor BufferAttachments = 1 << iota
BufferAttachmentDepth
)
const (
DepthFuncGreater DepthFunc = iota
)