refactor(wayland): continue implementing better buffer release
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
use super::buffer_params::BufferParams;
|
||||
use crate::{
|
||||
core::registry::Registry,
|
||||
wayland::{MessageSink, RENDER_DEVICE, core::buffer::BufferUsage},
|
||||
};
|
||||
use crate::wayland::{MessageSink, RENDER_DEVICE};
|
||||
use bevy::{
|
||||
asset::{Assets, Handle},
|
||||
image::Image,
|
||||
@@ -18,9 +15,6 @@ use std::sync::{Arc, OnceLock};
|
||||
use tracing::info;
|
||||
use waynest::server::protocol::stable::linux_dmabuf_v1::zwp_linux_buffer_params_v1::Flags;
|
||||
|
||||
// clear this out on end frame, add to it whenever a commit with the surface with the buffer is present
|
||||
const IN_USE_DMABUFS: Registry<BufferUsage> = Registry::new();
|
||||
|
||||
/// Parameters for a shared memory buffer
|
||||
pub struct DmabufBacking {
|
||||
message_sink: Option<MessageSink>,
|
||||
@@ -88,9 +82,7 @@ impl DmabufBacking {
|
||||
&self,
|
||||
dmatexes: &ImportedDmatexs,
|
||||
images: &mut Assets<Image>,
|
||||
usage: Arc<BufferUsage>,
|
||||
) -> Option<Handle<Image>> {
|
||||
IN_USE_DMABUFS.add_raw(usage);
|
||||
info!("updating dmabuf tex");
|
||||
self.pending_imported_dmatex
|
||||
.lock()
|
||||
|
||||
Reference in New Issue
Block a user