mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Fix implicit storage texture access
This commit is contained in:
parent
2fbb71a6d7
commit
9666967daf
@ -563,7 +563,7 @@ impl Resource {
|
|||||||
multisampled: multi,
|
multisampled: multi,
|
||||||
},
|
},
|
||||||
naga::ImageClass::Storage { format, .. } => BindingType::StorageTexture {
|
naga::ImageClass::Storage { format, .. } => BindingType::StorageTexture {
|
||||||
access: if shader_usage == GlobalUse::WRITE || shader_usage.is_empty() {
|
access: if !shader_usage.contains(GlobalUse::READ) {
|
||||||
wgt::StorageTextureAccess::WriteOnly
|
wgt::StorageTextureAccess::WriteOnly
|
||||||
} else if !features
|
} else if !features
|
||||||
.contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES)
|
.contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES)
|
||||||
@ -571,10 +571,10 @@ impl Resource {
|
|||||||
return Err(BindingError::UnsupportedTextureStorageAccess(
|
return Err(BindingError::UnsupportedTextureStorageAccess(
|
||||||
shader_usage,
|
shader_usage,
|
||||||
));
|
));
|
||||||
} else if shader_usage == GlobalUse::READ {
|
} else if shader_usage.contains(GlobalUse::WRITE) {
|
||||||
wgt::StorageTextureAccess::ReadOnly
|
|
||||||
} else {
|
|
||||||
wgt::StorageTextureAccess::ReadWrite
|
wgt::StorageTextureAccess::ReadWrite
|
||||||
|
} else {
|
||||||
|
wgt::StorageTextureAccess::ReadOnly
|
||||||
},
|
},
|
||||||
view_dimension,
|
view_dimension,
|
||||||
format: {
|
format: {
|
||||||
|
Loading…
Reference in New Issue
Block a user