File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -4004,16 +4004,23 @@ pub unsafe extern "C" fn wgpuSurfaceGetCurrentTexture(
4004
4004
}
4005
4005
4006
4006
#[ no_mangle]
4007
- pub unsafe extern "C" fn wgpuSurfacePresent ( surface : native:: WGPUSurface ) {
4007
+ pub unsafe extern "C" fn wgpuSurfacePresent ( surface : native:: WGPUSurface ) -> native :: WGPUStatus {
4008
4008
let surface = surface. as_ref ( ) . expect ( "invalid surface" ) ;
4009
4009
let context = & surface. context ;
4010
4010
4011
- match context. surface_present ( surface. id ) {
4012
- Ok ( _status) => surface
4013
- . has_surface_presented
4014
- . store ( true , atomic:: Ordering :: SeqCst ) ,
4015
- Err ( cause) => handle_error_fatal ( cause, "wgpuSurfacePresent" ) ,
4011
+ let _status = match context. surface_present ( surface. id ) {
4012
+ Ok ( status) => status,
4013
+ Err ( cause) => {
4014
+ log:: warn!( "Presentation error: {}" , cause) ;
4015
+ return native:: WGPUStatus_Error ;
4016
+ }
4016
4017
} ;
4018
+
4019
+ surface
4020
+ . has_surface_presented
4021
+ . store ( true , atomic:: Ordering :: SeqCst ) ;
4022
+
4023
+ native:: WGPUStatus_Success
4017
4024
}
4018
4025
4019
4026
#[ no_mangle]
You can’t perform that action at this time.
0 commit comments