Fix panic if indirect buffer has been destroyed (#8689)

This commit is contained in:
Andy Leiserson authored and GitHub committed 2025-12-08 21:17:52 -05:00
1 parent 1ddb5f25c2
commit d6ca9462e4
2 files changed
+8 -2

No files matched your search

+2
View File
@@ -65,6 +65,8 @@ webgpu:api,validation,encoding,cmds,index_access:*
webgpu:api,validation,encoding,cmds,render,draw:index_buffer_OOB:*
webgpu:api,validation,encoding,cmds,render,draw:unused_buffer_bound:*
webgpu:api,validation,encoding,cmds,render,dynamic_state:*
webgpu:api,validation,encoding,cmds,render,indirect_draw:indirect_buffer,device_mismatch:*
webgpu:api,validation,encoding,cmds,render,indirect_draw:indirect_buffer_usage:*
webgpu:api,validation,encoding,cmds,render,setIndexBuffer:*
webgpu:api,validation,encoding,cmds,render,setVertexBuffer:*
webgpu:api,validation,encoding,encoder_state:*
+6 -2
View File
@@ -3,10 +3,11 @@ use super::{
CreateIndirectValidationPipelineError,
};
use crate::{
command::RenderPassErrorInner,
device::{queue::TempResource, Device, DeviceError},
lock::{rank, Mutex},
pipeline::{CreateComputePipelineError, CreateShaderModuleError},
resource::{StagingBuffer, Trackable},
resource::{RawResourceAccess as _, StagingBuffer, Trackable},
snatch::SnatchGuard,
track::TrackerIndex,
FastHashMap,
@@ -199,7 +200,7 @@ impl Draw {
temp_resources: &mut Vec<TempResource>,
encoder: &mut dyn hal::DynCommandEncoder,
batcher: DrawBatcher,
) -> Result<(), DeviceError> {
) -> Result<(), RenderPassErrorInner> {
let mut batches = batcher.batches;
if batches.is_empty() {
@@ -378,6 +379,9 @@ impl Draw {
encoder.set_bind_group(pipeline_layout, 0, Some(metadata_bind_group), &[]);
}
// Make sure the indirect buffer is still valid.
batch.src_buffer.try_raw(snatch_guard)?;
let src_bind_group = batch
.src_buffer
.indirect_validation_bind_groups