mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-16 08:53:20 +00:00
add missing device valid check in create_texture_view
This commit is contained in:
parent
f767220399
commit
77e45d46df
@ -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)?;
|
||||
|
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user