Skip to content

Metal: Fixes for vertex binding state. - #45

Merged
DarioSamo merged 3 commits into
renderbag:mainfrom
squidbus:vertex-binding
Aug 3, 2025
Merged

Metal: Fixes for vertex binding state.#45
DarioSamo merged 3 commits into
renderbag:mainfrom
squidbus:vertex-binding

Conversation

@squidbus

Copy link
Copy Markdown
Contributor
  • Replace vertex buffer tracking vectors with two arrays of the maximum binding length and a dirty binding bit-flag.
  • Remove workaround to bind unused slots to null buffer as it is not needed anymore and was causing binding issues.
  • Tidy up binding ranges in Metal.
    • Descriptor sets: Up to 8, from 0 to 7
    • Push constants: Up to 4, from 8 to 11
    • Vertex buffers: Up to 19, from 12 to 30
    • Reflected with two sets of constants: external maximum counts and the internal start index for each.
  • Replaced buffer binding clamping with asserts as it will probably break something anyway if you hit it.

Fixes:

  • Vertex bindings being lost if multiple setVertexBuffers happen between dirty state flushes.
  • Vertex bindings being lost on partial bind.
  • Vertex bindings other than the last partial bind being lost if the render encoder changes.

@squidbus
squidbus requested review from DarioSamo and dcvz July 31, 2025 14:05
Comment thread plume_metal.cpp Outdated
Comment thread plume_metal.h Outdated
Comment thread plume_metal.h Outdated
Comment thread plume_metal.cpp Outdated
Comment thread plume_metal.cpp Outdated
@DarioSamo
DarioSamo merged commit dfe8500 into renderbag:main Aug 3, 2025
10 checks passed
@squidbus
squidbus deleted the vertex-binding branch August 7, 2025 22:19
jessetbh pushed a commit to jessetbh/plume that referenced this pull request Jul 6, 2026
* Metal: Fixes for vertex binding state.

* Metal: Clear vertex buffer bindings on command buffer end.

* Metal: Optimize vertex buffer dirty state handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants