Skip to content

Commit a843c88

Browse files
[metal] Fix handling of stage visibility for binding arrays (#7479)
Fixes #7287
1 parent 211d2ec commit a843c88

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

examples/features/src/texture_arrays/mod.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,6 @@ pub fn main() {
428428
crate::framework::run::<Example>("texture-arrays");
429429
}
430430

431-
#[cfg(test)]
432-
fn test_parameters() -> wgpu_test::TestParameters {
433-
wgpu_test::TestParameters::default()
434-
// https://github.com/gfx-rs/wgpu/issues/7287
435-
.expect_fail(wgpu_test::FailureCase::backend_adapter(
436-
wgpu::Backends::METAL,
437-
"Apple M",
438-
))
439-
}
440-
441431
#[cfg(test)]
442432
#[wgpu_test::gpu_test]
443433
static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams {
@@ -446,7 +436,7 @@ static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTest
446436
width: 1024,
447437
height: 768,
448438
optional_features: wgpu::Features::empty(),
449-
base_test_parameters: test_parameters(),
439+
base_test_parameters: wgpu_test::TestParameters::default(),
450440
comparisons: &[wgpu_test::ComparisonType::Mean(0.0)],
451441
_phantom: std::marker::PhantomData::<Example>,
452442
};
@@ -459,7 +449,7 @@ static TEST_UNIFORM: crate::framework::ExampleTestParams = crate::framework::Exa
459449
width: 1024,
460450
height: 768,
461451
optional_features: wgpu::Features::empty(),
462-
base_test_parameters: test_parameters(),
452+
base_test_parameters: wgpu_test::TestParameters::default(),
463453
comparisons: &[wgpu_test::ComparisonType::Mean(0.0)],
464454
_phantom: std::marker::PhantomData::<Example>,
465455
};
@@ -474,7 +464,7 @@ static TEST_NON_UNIFORM: crate::framework::ExampleTestParams =
474464
height: 768,
475465
optional_features:
476466
wgpu::Features::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING,
477-
base_test_parameters: test_parameters(),
467+
base_test_parameters: wgpu_test::TestParameters::default(),
478468
comparisons: &[wgpu_test::ComparisonType::Mean(0.0)],
479469
_phantom: std::marker::PhantomData::<Example>,
480470
};

wgpu-hal/src/metal/device.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,10 @@ impl crate::Device for super::Device {
831831
for (entry, layout) in layout_and_entry_iter {
832832
// Bindless path
833833
if layout.count.is_some() {
834+
if !layout.visibility.contains(stage_bit) {
835+
continue;
836+
}
837+
834838
let count = entry.count;
835839

836840
let stages = conv::map_render_stages(layout.visibility);

0 commit comments

Comments
 (0)