Skip to content

Commit

Permalink
Stop using storage usage for sampling (#2703)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored May 29, 2022
1 parent c12ae08 commit fd954a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 1 addition & 11 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,16 +1017,6 @@ impl<A: HalApi> Device<A> {
format_features: texture.format_features,
extent,
samples: texture.desc.sample_count,
// once a storage - forever a storage
sampled_internal_use: if texture
.desc
.usage
.contains(wgt::TextureUsages::STORAGE_BINDING)
{
hal::TextureUses::RESOURCE | hal::TextureUses::STORAGE_READ
} else {
hal::TextureUses::RESOURCE
},
selector,
life_guard: LifeGuard::new(desc.label.borrow_or_default()),
})
Expand Down Expand Up @@ -1996,7 +1986,7 @@ impl<A: HalApi> Device<A> {
}
Ok((
wgt::TextureUsages::TEXTURE_BINDING,
view.sampled_internal_use,
hal::TextureUses::RESOURCE,
))
}
wgt::BindingType::StorageTexture {
Expand Down
2 changes: 0 additions & 2 deletions wgpu-core/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,6 @@ pub struct TextureView<A: hal::Api> {
pub(crate) format_features: wgt::TextureFormatFeatures,
pub(crate) extent: wgt::Extent3d,
pub(crate) samples: u32,
/// Internal use of this texture view when used as `BindingType::Texture`.
pub(crate) sampled_internal_use: hal::TextureUses,
pub(crate) selector: TextureSelector,
pub(crate) life_guard: LifeGuard,
}
Expand Down

0 comments on commit fd954a2

Please sign in to comment.