File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,10 +67,10 @@ members = [
6767]
6868
6969[workspace .package ]
70- version = " 0.1.7 "
70+ version = " 0.1.8 "
7171authors = [" Lochlan Wansbrough" ]
7272edition = " 2021"
7373rust-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 " }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
3233impl 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments