rename TFC::STORAGE to STORAGE_WRITE (#6621)

This commit is contained in:
atlv 2024-12-01 17:53:27 -05:00 committed by GitHub
parent 61dc75edc5
commit 5e52a313b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 20 deletions

View File

@ -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,

View File

@ -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),

View File

@ -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) {

View File

@ -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.

View File

@ -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 {

View File

@ -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(