Merge pull request #681 from fuzeofficlal/fix/vertex-buffer-null-unbind

GPU: unbind vertex buffer slots for null view arrays
This commit is contained in:
Marvis authored and GitHub committed 2026-11-24 09:22:41 +01:00
commit 5cd7421715
2 files changed
+11 -1

No files matched your search

+6
View File
@@ -244,6 +244,12 @@ impl State {
}
}
pub(crate) fn clear_vertex_buffers(&mut self, start: u32, count: u32) {
for slot in self.vertex.iter_mut().skip(start as usize).take(count as usize) {
*slot = VertexView::default();
}
}
pub(crate) fn set_index_buffer(&mut self, view: Option<&IndexView>) {
self.index = view.copied().unwrap_or_default();
}
+5 -1
View File
@@ -1015,7 +1015,11 @@ mod state {
views: *const VertexView,
) {
with_state(this, |_, s| {
s.set_vertex_buffers(start, items(views, count))
if views.is_null() {
s.clear_vertex_buffers(start, count);
} else {
s.set_vertex_buffers(start, items(views, count));
}
});
}
/// `(count, handles, one range, depth)`: with one range, the handles