Skip to content

Commit

Permalink
Fix wayland error on drop
Browse files Browse the repository at this point in the history
It seems to be related to this issue:

gfx-rs/wgpu#4650
  • Loading branch information
hasenbanck committed Jan 23, 2025
1 parent 8af55cb commit c1cd910
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
24 changes: 12 additions & 12 deletions korangar/src/graphics/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ pub struct GraphicsEngineDescriptor {
/// Set 3: Resource Bindings (for example a texture group of a map)
pub struct GraphicsEngine {
capabilities: Capabilities,
instance: Instance,
adapter: Arc<Adapter>,
device: Arc<Device>,
queue: Arc<Queue>,
staging_belt: StagingBelt,
surface: Option<Surface>,
frame_pacer: FramePacer,
cpu_stage: FrameStage<Instant>,
limit_framerate: bool,
Expand All @@ -66,6 +60,12 @@ pub struct GraphicsEngine {
picker_value: Arc<AtomicU64>,
entity_sort_buffer: Vec<EntityInstruction>,
model_sort_buffer: Vec<ModelInstruction>,
staging_belt: StagingBelt,
queue: Arc<Queue>,
device: Arc<Device>,
adapter: Arc<Adapter>,
instance: Instance,
surface: Option<Surface>,
}

struct EngineContext {
Expand Down Expand Up @@ -120,12 +120,6 @@ impl GraphicsEngine {

Self {
capabilities: descriptor.capabilities,
instance: descriptor.instance,
adapter: descriptor.adapter,
device: descriptor.device,
queue: descriptor.queue,
staging_belt,
surface: None,
frame_pacer,
cpu_stage,
limit_framerate: false,
Expand All @@ -135,6 +129,12 @@ impl GraphicsEngine {
picker_value: descriptor.picker_value,
entity_sort_buffer: vec![],
model_sort_buffer: vec![],
staging_belt,
queue: descriptor.queue,
device: descriptor.device,
adapter: descriptor.adapter,
instance: descriptor.instance,
surface: None,
}
}

Expand Down
48 changes: 24 additions & 24 deletions korangar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,6 @@ fn main() {
}

struct Client {
window: Option<Arc<Window>>,
#[cfg(feature = "debug")]
device: Arc<Device>,
#[cfg(feature = "debug")]
queue: Arc<Queue>,
graphics_engine: GraphicsEngine,
audio_engine: Arc<AudioEngine<GameFileLoader>>,
#[cfg(feature = "debug")]
packet_history_callback: PacketHistoryCallback,
#[cfg(feature = "debug")]
networking_system: NetworkingSystem<PacketHistoryCallback>,
#[cfg(not(feature = "debug"))]
networking_system: NetworkingSystem<NoPacketCallback>,

action_loader: Arc<ActionLoader>,
async_loader: Arc<AsyncLoader>,
effect_loader: Arc<EffectLoader>,
Expand Down Expand Up @@ -272,6 +258,20 @@ struct Client {
main_menu_click_sound_effect: SoundEffectKey,

map: Option<Box<Map>>,

#[cfg(feature = "debug")]
packet_history_callback: PacketHistoryCallback,
#[cfg(feature = "debug")]
networking_system: NetworkingSystem<PacketHistoryCallback>,
#[cfg(not(feature = "debug"))]
networking_system: NetworkingSystem<NoPacketCallback>,
audio_engine: Arc<AudioEngine<GameFileLoader>>,
graphics_engine: GraphicsEngine,
#[cfg(feature = "debug")]
queue: Arc<Queue>,
#[cfg(feature = "debug")]
device: Arc<Device>,
window: Option<Arc<Window>>,
}

impl Client {
Expand Down Expand Up @@ -590,16 +590,6 @@ impl Client {
});

Self {
window: None,
#[cfg(feature = "debug")]
device,
#[cfg(feature = "debug")]
queue,
graphics_engine,
audio_engine,
#[cfg(feature = "debug")]
packet_history_callback,
networking_system,
action_loader,
async_loader,
effect_loader,
Expand Down Expand Up @@ -700,6 +690,16 @@ impl Client {
chat_messages,
main_menu_click_sound_effect,
map: Some(map),
#[cfg(feature = "debug")]
packet_history_callback,
networking_system,
audio_engine,
graphics_engine,
#[cfg(feature = "debug")]
queue,
#[cfg(feature = "debug")]
device,
window: None,
}
}

Expand Down

0 comments on commit c1cd910

Please sign in to comment.