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:
Elias Naur
2021-08-11 16:27:25 +02:00
parent 1af910959b
commit 58cc817e5f
7 changed files with 76 additions and 44 deletions
+7 -2
View File
@@ -38,7 +38,7 @@ type Device interface {
BindPipeline(p Pipeline)
BindFramebuffer(f Framebuffer, a LoadDesc)
BindTexture(unit int, t Texture)
BindVertexBuffer(b Buffer, stride, offset int)
BindVertexBuffer(b Buffer, offset int)
BindIndexBuffer(b Buffer)
BindImageTexture(unit int, texture Texture, access AccessBits, format TextureFormat)
BindVertexUniforms(buf Buffer)
@@ -69,11 +69,16 @@ type Pipeline interface {
type PipelineDesc struct {
VertexShader VertexShader
FragmentShader FragmentShader
VertexLayout []InputDesc
VertexLayout VertexLayout
BlendDesc BlendDesc
PixelFormat TextureFormat
}
type VertexLayout struct {
Inputs []InputDesc
Stride int
}
// InputDesc describes a vertex attribute as laid out in a Buffer.
type InputDesc struct {
Type shader.DataType