remove parent_id field of TextureInner::Surface

The `parent_id` will always match `surface_id` because we got the texture from the `acquired_texture` field.
This commit is contained in:
teoxoy authored and Teodor Tanasoaia committed 2024-10-14 13:24:44 +02:00
1 parent c38ed8d9fa
commit e86330977b
2 files changed
+6 -19

No files matched your search

+6 -18
View File
@@ -194,10 +194,7 @@ impl Global {
let present = presentation.as_mut().unwrap();
let texture = resource::Texture::new(
&device,
resource::TextureInner::Surface {
raw: ast.texture,
parent_id: surface_id,
},
resource::TextureInner::Surface { raw: ast.texture },
hal_usage,
&texture_desc,
format_features,
@@ -293,14 +290,9 @@ impl Global {
.snatch(&mut device.snatchable_lock.write())
.unwrap()
{
resource::TextureInner::Surface { raw, parent_id } => {
if surface_id != parent_id {
log::error!("Presented frame is from a different surface");
Err(hal::SurfaceError::Lost)
} else {
unsafe { queue.raw().present(suf, raw) }
}
}
resource::TextureInner::Surface { raw } => unsafe {
queue.raw().present(suf, raw)
},
_ => unreachable!(),
}
} else {
@@ -367,12 +359,8 @@ impl Global {
.snatch(&mut device.snatchable_lock.write())
.unwrap()
{
resource::TextureInner::Surface { raw, parent_id } => {
if surface_id == parent_id {
unsafe { suf.unwrap().discard_texture(raw) };
} else {
log::warn!("Surface texture is outdated");
}
resource::TextureInner::Surface { raw } => {
unsafe { suf.unwrap().discard_texture(raw) };
}
_ => unreachable!(),
}
-1
View File
@@ -989,7 +989,6 @@ pub(crate) enum TextureInner {
},
Surface {
raw: Box<dyn hal::DynSurfaceTexture>,
parent_id: SurfaceId,
},
}