add missing device valid check in create_texture_view

This commit is contained in:
teoxoy authored and Erich Gubler committed 2024-07-18 10:29:08 -04:00
1 parent f767220399
commit 77e45d46df
2 files changed
+4

No files matched your search

+2
View File
@@ -991,6 +991,8 @@ impl<A: HalApi> Device<A> {
texture: &Arc<Texture<A>>,
desc: &resource::TextureViewDescriptor,
) -> Result<Arc<TextureView<A>>, resource::CreateTextureViewError> {
self.check_is_valid()?;
let snatch_guard = texture.device.snatchable_lock.read();
let texture_raw = texture.try_raw(&snatch_guard)?;
+2
View File
@@ -1632,6 +1632,8 @@ impl<A: HalApi> TextureView<A> {
#[derive(Clone, Debug, Error)]
#[non_exhaustive]
pub enum CreateTextureViewError {
#[error(transparent)]
Device(#[from] DeviceError),
#[error("TextureId {0:?} is invalid")]
InvalidTextureId(TextureId),
#[error(transparent)]