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

+8 -1
View File
@@ -8,7 +8,7 @@ use crate::{
track::UsageConflict,
validation::{MissingBufferUsageError, MissingTextureUsageError},
};
use wgt::{BufferAddress, BufferSize, Color};
use wgt::{BufferAddress, BufferSize, Color, VertexStepMode};
use std::num::NonZeroU32;
use thiserror::Error;
@@ -33,6 +33,13 @@ pub enum DrawError {
vertex_limit: u64,
slot: u32,
},
#[error("{step_mode:?} buffer out of bounds at slot {slot}. Offset {offset} beyond limit {limit}. Did you bind the correct `Vertex` step-rate vertex buffer?")]
VertexOutOfBounds {
step_mode: VertexStepMode,
offset: u64,
limit: u64,
slot: u32,
},
#[error("Instance {last_instance} extends beyond limit {instance_limit} imposed by the buffer in slot {slot}. Did you bind the correct `Instance` step-rate vertex buffer?")]
InstanceBeyondLimit {
last_instance: u64,