gpu: rename DrawMode to Topology and move it to pipeline descriptors

Vulkan needs the topology stated in its pipeline descriptor, not at
draw time.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-09-08 09:48:48 +02:00
parent 41e812d5e8
commit 3d1e9b0856
8 changed files with 82 additions and 65 deletions
+6 -5
View File
@@ -32,8 +32,8 @@ type Device interface {
NewPipeline(desc PipelineDesc) (Pipeline, error)
Viewport(x, y, width, height int)
DrawArrays(mode DrawMode, off, count int)
DrawElements(mode DrawMode, off, count int)
DrawArrays(off, count int)
DrawElements(off, count int)
BeginRenderPass(f Framebuffer, desc LoadDesc)
EndRenderPass()
@@ -71,6 +71,7 @@ type PipelineDesc struct {
VertexLayout VertexLayout
BlendDesc BlendDesc
PixelFormat TextureFormat
Topology Topology
}
type VertexLayout struct {
@@ -95,7 +96,7 @@ type AccessBits uint8
type BlendFactor uint8
type DrawMode uint8
type Topology uint8
type TextureFilter uint8
type TextureFormat uint8
@@ -186,8 +187,8 @@ const (
)
const (
DrawModeTriangleStrip DrawMode = iota
DrawModeTriangles
TopologyTriangleStrip Topology = iota
TopologyTriangles
)
const (