Fix the validation of vertex/index/instance ranges in render bundles

This commit is contained in:
Nicolas Silva authored and Teodor Tanasoaia committed 2024-01-26 17:26:44 +01:00
1 parent d47534ed9a
commit e2e9ef5547
5 files changed
+131 -88

No files matched your search

+5
View File
@@ -2717,8 +2717,13 @@ impl<A: HalApi> Device<A> {
let mut shader_expects_dual_source_blending = false;
let mut pipeline_expects_dual_source_blending = false;
for (i, vb_state) in desc.vertex.buffers.iter().enumerate() {
let mut last_stride = 0;
for attribute in vb_state.attributes.iter() {
last_stride = last_stride.max(attribute.offset + attribute.format.size());
}
vertex_steps.push(pipeline::VertexStep {
stride: vb_state.array_stride,
last_stride,
mode: vb_state.step_mode,
});
if vb_state.attributes.is_empty() {