wgui: introduce SharedContext to share between Contexts

This commit is contained in:
galister
2025-06-25 21:06:05 +09:00
parent 44b6da8967
commit 158562031f
5 changed files with 363 additions and 322 deletions

View File

@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
use smallvec::{SmallVec, smallvec};
use std::sync::Arc;
use vulkano::image::view::ImageView;
use wgui::gfx::WGfx;
use wgui::{gfx::WGfx, renderer_vk::context::SharedContext as WSharedContext};
#[cfg(feature = "wayvr")]
use {
@@ -34,6 +34,8 @@ pub struct AppState {
pub hid_provider: HidWrapper,
pub audio_provider: AudioOutput,
pub wgui_shared: WSharedContext,
pub input_state: InputState,
pub screens: SmallVec<[ScreenMeta; 8]>,
pub anchor: Affine3A,
@@ -71,6 +73,8 @@ impl AppState {
include_bytes!("res/557297.wav"),
);
let wgui_shared = WSharedContext::new(gfx.clone())?;
Ok(Self {
session,
tasks,
@@ -78,6 +82,7 @@ impl AppState {
gfx_extras,
hid_provider: HidWrapper::new(),
audio_provider: AudioOutput::new(),
wgui_shared,
input_state: InputState::new(),
screens: smallvec![],
anchor: Affine3A::IDENTITY,