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
+4 -2
View File
@@ -56,6 +56,7 @@ func TestSimpleShader(t *testing.T) {
VertexShader: vsh,
FragmentShader: fsh,
PixelFormat: driver.TextureFormatSRGBA,
Topology: driver.TopologyTriangles,
})
if err != nil {
t.Fatal(err)
@@ -68,7 +69,7 @@ func TestSimpleShader(t *testing.T) {
b.BeginRenderPass(fbo, d)
b.Viewport(0, 0, sz.X, sz.Y)
b.BindPipeline(p)
b.DrawArrays(driver.DrawModeTriangles, 0, 3)
b.DrawArrays(0, 3)
b.EndRenderPass()
img := screenshot(t, b, fbo, sz)
if got := img.RGBAAt(0, 0); got != clearColExpect {
@@ -107,6 +108,7 @@ func TestInputShader(t *testing.T) {
FragmentShader: fsh,
VertexLayout: layout,
PixelFormat: driver.TextureFormatSRGBA,
Topology: driver.TopologyTriangles,
})
if err != nil {
t.Fatal(err)
@@ -131,7 +133,7 @@ func TestInputShader(t *testing.T) {
b.Viewport(0, 0, sz.X, sz.Y)
b.BindPipeline(pipe)
b.BindVertexBuffer(buf, 0)
b.DrawArrays(driver.DrawModeTriangles, 0, 3)
b.DrawArrays(0, 3)
b.EndRenderPass()
img := screenshot(t, b, fbo, sz)
if got := img.RGBAAt(0, 0); got != clearColExpect {