diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index 89b37c78a7..b640513fbd 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -512,7 +512,7 @@ impl Adapter { ); allowed_usages.set( wgt::TextureUsages::STORAGE_BINDING, - caps.contains(Tfc::STORAGE), + caps.contains(Tfc::STORAGE_WRITE), ); allowed_usages.set( wgt::TextureUsages::RENDER_ATTACHMENT, diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index d037adc96d..b88941c81e 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -670,7 +670,7 @@ impl crate::Adapter for super::Adapter { ); // UAVs use srv_uav_format caps.set( - Tfc::STORAGE, + Tfc::STORAGE_WRITE, data_srv_uav .Support1 .contains(Direct3D12::D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW), diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index 032ad1b46b..7d2ba2d23d 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -1038,7 +1038,7 @@ impl crate::Adapter for super::Adapter { let renderable = unfilterable | Tfc::COLOR_ATTACHMENT | sample_count | Tfc::MULTISAMPLE_RESOLVE; let filterable_renderable = filterable | renderable | Tfc::COLOR_ATTACHMENT_BLEND; - let storage = base | Tfc::STORAGE | Tfc::STORAGE_READ_WRITE; + let storage = base | Tfc::STORAGE_WRITE | Tfc::STORAGE_READ_WRITE; let feature_fn = |f, caps| { if self.shared.features.contains(f) { diff --git a/wgpu-hal/src/lib.rs b/wgpu-hal/src/lib.rs index 4707289bd1..44ee9fb9aa 100644 --- a/wgpu-hal/src/lib.rs +++ b/wgpu-hal/src/lib.rs @@ -1544,7 +1544,7 @@ bitflags!( const SAMPLED_MINMAX = 1 << 2; /// Format can be used as storage with write-only access. - const STORAGE = 1 << 3; + const STORAGE_WRITE = 1 << 3; /// Format can be used as storage with read and read/write access. const STORAGE_READ_WRITE = 1 << 4; /// Format can be used as storage with atomics. diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index e1b4ec6094..bb7b9926ac 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -111,7 +111,7 @@ impl crate::Adapter for super::Adapter { // Metal defined pixel format capabilities let all_caps = Tfc::SAMPLED_LINEAR - | Tfc::STORAGE + | Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT | Tfc::COLOR_ATTACHMENT_BLEND | msaa_count @@ -134,7 +134,7 @@ impl crate::Adapter for super::Adapter { | Tf::Rgba8Sint | Tf::Rgba16Uint | Tf::Rgba16Sint => { - read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | msaa_count + read_write_tier2_if | Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT | msaa_count } Tf::R16Unorm | Tf::R16Snorm @@ -143,59 +143,65 @@ impl crate::Adapter for super::Adapter { | Tf::Rgba16Unorm | Tf::Rgba16Snorm => { Tfc::SAMPLED_LINEAR - | Tfc::STORAGE + | Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT | Tfc::COLOR_ATTACHMENT_BLEND | msaa_count | msaa_resolve_desktop_if } Tf::Rg8Unorm | Tf::Rg16Float | Tf::Bgra8Unorm => all_caps, - Tf::Rg8Uint | Tf::Rg8Sint => Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | msaa_count, + Tf::Rg8Uint | Tf::Rg8Sint => Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT | msaa_count, Tf::R32Uint | Tf::R32Sint => { - read_write_tier1_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | msaa_count + read_write_tier1_if | Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT | msaa_count } Tf::R32Float => { let flags = if pc.format_r32float_all { all_caps } else { - Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::COLOR_ATTACHMENT_BLEND | msaa_count + Tfc::STORAGE_WRITE + | Tfc::COLOR_ATTACHMENT + | Tfc::COLOR_ATTACHMENT_BLEND + | msaa_count }; read_write_tier1_if | flags } - Tf::Rg16Uint | Tf::Rg16Sint => Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | msaa_count, + Tf::Rg16Uint | Tf::Rg16Sint => Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT | msaa_count, Tf::Rgba8UnormSrgb | Tf::Bgra8UnormSrgb => { let mut flags = all_caps; - flags.set(Tfc::STORAGE, pc.format_rgba8_srgb_all); + flags.set(Tfc::STORAGE_WRITE, pc.format_rgba8_srgb_all); flags } Tf::Rgb10a2Uint => { let mut flags = Tfc::COLOR_ATTACHMENT | msaa_count; - flags.set(Tfc::STORAGE, pc.format_rgb10a2_uint_write); + flags.set(Tfc::STORAGE_WRITE, pc.format_rgb10a2_uint_write); flags } Tf::Rgb10a2Unorm => { let mut flags = all_caps; - flags.set(Tfc::STORAGE, pc.format_rgb10a2_unorm_all); + flags.set(Tfc::STORAGE_WRITE, pc.format_rgb10a2_unorm_all); flags } Tf::Rg11b10Ufloat => { let mut flags = all_caps; - flags.set(Tfc::STORAGE, pc.format_rg11b10_all); + flags.set(Tfc::STORAGE_WRITE, pc.format_rg11b10_all); flags } - Tf::Rg32Uint | Tf::Rg32Sint => Tfc::COLOR_ATTACHMENT | Tfc::STORAGE | msaa_count, + Tf::Rg32Uint | Tf::Rg32Sint => Tfc::COLOR_ATTACHMENT | Tfc::STORAGE_WRITE | msaa_count, Tf::Rg32Float => { if pc.format_rg32float_all { all_caps } else { - Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::COLOR_ATTACHMENT_BLEND | msaa_count + Tfc::STORAGE_WRITE + | Tfc::COLOR_ATTACHMENT + | Tfc::COLOR_ATTACHMENT_BLEND + | msaa_count } } Tf::Rgba32Uint | Tf::Rgba32Sint => { - read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | msaa_count + read_write_tier2_if | Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT | msaa_count } Tf::Rgba32Float => { - let mut flags = read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT; + let mut flags = read_write_tier2_if | Tfc::STORAGE_WRITE | Tfc::COLOR_ATTACHMENT; if pc.format_rgba32float_all { flags |= all_caps } else if pc.msaa_apple7 { diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index 6e88e03b8c..40340ca03b 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -2115,7 +2115,7 @@ impl crate::Adapter for super::Adapter { // features.contains(vk::FormatFeatureFlags::SAMPLED_IMAGE_FILTER_MINMAX), // ); flags.set( - Tfc::STORAGE | Tfc::STORAGE_READ_WRITE, + Tfc::STORAGE_WRITE | Tfc::STORAGE_READ_WRITE, features.contains(vk::FormatFeatureFlags::STORAGE_IMAGE), ); flags.set(