GPU: unbind vertex buffer slots for null view arrays

This commit is contained in:
fuzeofficial committed 2026-11-24 15:42:18 +09:00
1 parent 35e8407c9c
commit dfec73981b
2 files changed
+11 -1

No files matched your search

+6
View File
@@ -242,6 +242,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
@@ -1007,7 +1007,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