Skip to content

Commit 08419b1

Browse files
author
Lochlan Wansbrough
committed
v0.1.8
1 parent 5dd90a1 commit 08419b1

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ members = [
6767
]
6868

6969
[workspace.package]
70-
version = "0.1.7"
70+
version = "0.1.8"
7171
authors = ["Lochlan Wansbrough"]
7272
edition = "2021"
7373
rust-version = "1.80.0"
7474

7575
[workspace.dependencies]
76-
rune = { path = "crates/rune", version = "0.1.7" }
76+
rune = { path = "crates/rune", version = "0.1.8" }

crates/rune/src/game.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ impl Game {
125125
let store = self.store.as_mut().expect("Store must be initialized");
126126
let ctx = store.data_mut();
127127
let surface_id = ctx.surface;
128-
ctx.instance.surface_present(surface_id)?;
128+
129+
if ctx.gpu_state.present_surface {
130+
ctx.instance.surface_present(surface_id)?;
131+
ctx.gpu_state.present_surface = false;
132+
}
129133

130134
Ok(())
131135
}

crates/rune/src/runtime/common/gpu.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub struct GpuState {
2727
pub buffers: HashMap<BufferId, Buffer>,
2828
pub query_sets: HashMap<QuerySetId, QuerySet>,
2929
pub textures: HashMap<TextureId, Texture>,
30+
pub present_surface: bool
3031
}
3132

3233
impl GpuState {
@@ -35,6 +36,7 @@ impl GpuState {
3536
buffers: HashMap::new(),
3637
query_sets: HashMap::new(),
3738
textures: HashMap::new(),
39+
present_surface: false
3840
}
3941
}
4042
}

crates/rune/src/runtime/native/gpu.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ impl HostGpuSurface for RuneRuntimeState {
5252
.surface_get_current_texture(self.surface, None)
5353
.unwrap();
5454

55+
self.gpu_state.present_surface = true;
56+
5557
self.table.push(surface_output.texture_id.unwrap()).unwrap()
5658
}
5759

0 commit comments

Comments
 (0)