Skip to content

Commit 77e45d4

Browse files
teoxoyErichDonGubler
authored andcommitted
add missing device valid check in create_texture_view
1 parent f767220 commit 77e45d4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

wgpu-core/src/device/resource.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,8 @@ impl<A: HalApi> Device<A> {
991991
texture: &Arc<Texture<A>>,
992992
desc: &resource::TextureViewDescriptor,
993993
) -> Result<Arc<TextureView<A>>, resource::CreateTextureViewError> {
994+
self.check_is_valid()?;
995+
994996
let snatch_guard = texture.device.snatchable_lock.read();
995997

996998
let texture_raw = texture.try_raw(&snatch_guard)?;

wgpu-core/src/resource.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,8 @@ impl<A: HalApi> TextureView<A> {
16321632
#[derive(Clone, Debug, Error)]
16331633
#[non_exhaustive]
16341634
pub enum CreateTextureViewError {
1635+
#[error(transparent)]
1636+
Device(#[from] DeviceError),
16351637
#[error("TextureId {0:?} is invalid")]
16361638
InvalidTextureId(TextureId),
16371639
#[error(transparent)]

0 commit comments

Comments
 (0)