mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
gpu,gpu/internal: move vertex buffer stride to pipeline state
Metal needs the vertex stride at pipeline creation. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -77,12 +77,15 @@ func TestInputShader(t *testing.T) {
|
||||
}
|
||||
defer vsh.Release()
|
||||
defer fsh.Release()
|
||||
layout := []driver.InputDesc{
|
||||
{
|
||||
Type: shader.DataTypeFloat,
|
||||
Size: 4,
|
||||
Offset: 0,
|
||||
layout := driver.VertexLayout{
|
||||
Inputs: []driver.InputDesc{
|
||||
{
|
||||
Type: shader.DataTypeFloat,
|
||||
Size: 4,
|
||||
Offset: 0,
|
||||
},
|
||||
},
|
||||
Stride: 4 * 4,
|
||||
}
|
||||
pipe, err := b.NewPipeline(driver.PipelineDesc{
|
||||
VertexShader: vsh,
|
||||
@@ -106,7 +109,7 @@ func TestInputShader(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer buf.Release()
|
||||
b.BindVertexBuffer(buf, 4*4, 0)
|
||||
b.BindVertexBuffer(buf, 0)
|
||||
b.DrawArrays(driver.DrawModeTriangles, 0, 3)
|
||||
img := screenshot(t, b, fbo, sz)
|
||||
if got := img.RGBAAt(0, 0); got != clearColExpect {
|
||||
|
||||
Reference in New Issue
Block a user