mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 00:16:15 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user