Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206

- Added support for transient textures on Vulkan and Metal. By @opstic in [#8247](https://github.com/gfx-rs/wgpu/pull/8247)
- Implement shader triangle barycentric coordinate builtins. By @atlv24 in [#8320](https://github.com/gfx-rs/wgpu/pull/8320).
- Added support for binding arrays of storage textures on Metal. By @msvbg in [#8464](https://github.com/gfx-rs/wgpu/pull/8464)

### Changes

Expand Down
8 changes: 5 additions & 3 deletions naga/src/back/msl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7099,9 +7099,11 @@ template <typename A>
}
}
crate::ImageClass::Storage { .. } => {
return Err(Error::UnsupportedArrayOf(
"read-write textures".to_string(),
));
if options.lang_version < (3, 0) {
return Err(Error::UnsupportedArrayOf(
"read-write textures".to_string(),
));
}
}
crate::ImageClass::External => {
return Err(Error::UnsupportedArrayOf(
Expand Down
10 changes: 4 additions & 6 deletions tests/tests/wgpu-gpu/binding_array/storage_textures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::num::NonZeroU32;

use wgpu::*;
use wgpu_test::{
gpu_test, image::ReadbackBuffers, FailureCase, GpuTestConfiguration, GpuTestInitializer,
TestParameters, TestingContext,
gpu_test, image::ReadbackBuffers, GpuTestConfiguration, GpuTestInitializer, TestParameters,
TestingContext,
};

pub fn all_tests(tests: &mut Vec<GpuTestInitializer>) {
Expand All @@ -26,8 +26,7 @@ static BINDING_ARRAY_STORAGE_TEXTURES: GpuTestConfiguration = GpuTestConfigurati
.limits(Limits {
max_binding_array_elements_per_shader_stage: 17,
..Limits::default()
})
.expect_fail(FailureCase::backend(Backends::METAL)),
}),
)
.run_async(|ctx| async move { binding_array_storage_textures(ctx, false).await });

Expand All @@ -45,8 +44,7 @@ static PARTIAL_BINDING_ARRAY_STORAGE_TEXTURES: GpuTestConfiguration = GpuTestCon
.limits(Limits {
max_binding_array_elements_per_shader_stage: 33,
..Limits::default()
})
.expect_fail(FailureCase::backend(Backends::METAL)),
}),
)
.run_async(|ctx| async move { binding_array_storage_textures(ctx, true).await });

Expand Down
7 changes: 7 additions & 0 deletions wgpu-hal/src/metal/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,13 @@ impl super::PrivateCapabilities {
&& self.supports_arrays_of_textures
&& self.argument_buffers as u64 >= MTLArgumentBuffersTier::Tier2 as u64,
);
features.set(
F::STORAGE_RESOURCE_BINDING_ARRAY,
self.msl_version >= MTLLanguageVersion::V3_0
&& self.supports_arrays_of_textures
&& self.supports_arrays_of_textures_write
&& self.argument_buffers as u64 >= MTLArgumentBuffersTier::Tier2 as u64,
);
features.set(
F::SHADER_INT64,
self.int64 && self.msl_version >= MTLLanguageVersion::V2_3,
Expand Down