From 136edde52a1ec04fac38f72051c7bdc138427e60 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Sat, 6 Dec 2025 19:29:59 -0500 Subject: [PATCH] Widen checks for the creation of the indirect validator --- wgpu-core/src/device/resource.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index ada334007..56fb7398d 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -433,14 +433,17 @@ impl Device { } .map_err(DeviceError::from_hal)?; + // Cloned as we need them below anyway. let alignments = adapter.raw.capabilities.alignments.clone(); let downlevel = adapter.raw.capabilities.downlevel.clone(); + let limits = &adapter.raw.capabilities.limits; let enable_indirect_validation = instance_flags .contains(wgt::InstanceFlags::VALIDATION_INDIRECT_CALL) - && downlevel - .flags - .contains(wgt::DownlevelFlags::INDIRECT_EXECUTION); + && downlevel.flags.contains( + wgt::DownlevelFlags::INDIRECT_EXECUTION | wgt::DownlevelFlags::COMPUTE_SHADERS, + ) + && limits.max_storage_buffers_per_shader_stage >= 2; let indirect_validation = if enable_indirect_validation { Some(crate::indirect_validation::IndirectValidation::new(