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