Skip to content

Commit 136edde

Browse files
cwfitzgeraldteoxoy
authored andcommitted
Widen checks for the creation of the indirect validator
1 parent e3149ba commit 136edde

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

wgpu-core/src/device/resource.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,17 @@ impl Device {
433433
}
434434
.map_err(DeviceError::from_hal)?;
435435

436+
// Cloned as we need them below anyway.
436437
let alignments = adapter.raw.capabilities.alignments.clone();
437438
let downlevel = adapter.raw.capabilities.downlevel.clone();
439+
let limits = &adapter.raw.capabilities.limits;
438440

439441
let enable_indirect_validation = instance_flags
440442
.contains(wgt::InstanceFlags::VALIDATION_INDIRECT_CALL)
441-
&& downlevel
442-
.flags
443-
.contains(wgt::DownlevelFlags::INDIRECT_EXECUTION);
443+
&& downlevel.flags.contains(
444+
wgt::DownlevelFlags::INDIRECT_EXECUTION | wgt::DownlevelFlags::COMPUTE_SHADERS,
445+
)
446+
&& limits.max_storage_buffers_per_shader_stage >= 2;
444447

445448
let indirect_validation = if enable_indirect_validation {
446449
Some(crate::indirect_validation::IndirectValidation::new(

0 commit comments

Comments
 (0)