@@ -5,6 +5,7 @@ use std::os::raw::c_char;
55use ash:: {
66 ext:: metal_surface,
77 khr:: { android_surface, surface, wayland_surface, win32_surface, xcb_surface, xlib_surface} ,
8+ ohos:: surface as ohos_surface,
89 vk, Entry , Instance , VkResult ,
910} ;
1011use raw_window_handle:: { RawDisplayHandle , RawWindowHandle } ;
@@ -94,6 +95,13 @@ pub unsafe fn create_surface(
9495 surface_fn. create_android_surface ( & surface_desc, allocation_callbacks)
9596 }
9697
98+ ( RawDisplayHandle :: Ohos ( _) , RawWindowHandle :: OhosNdk ( window) ) => {
99+ let surface_desc =
100+ vk:: SurfaceCreateInfoOHOS :: default ( ) . window ( window. native_window . as_ptr ( ) ) ;
101+ let surface_fn = ohos_surface:: Instance :: new ( entry, instance) ;
102+ surface_fn. create_surface ( & surface_desc, allocation_callbacks)
103+ }
104+
97105 #[ cfg( target_os = "macos" ) ]
98106 ( RawDisplayHandle :: AppKit ( _) , RawWindowHandle :: AppKit ( window) ) => {
99107 use raw_window_metal:: { appkit, Layer } ;
@@ -165,6 +173,12 @@ pub fn enumerate_required_extensions(
165173 & ANDROID_EXTS
166174 }
167175
176+ RawDisplayHandle :: Ohos ( _) => {
177+ const OHOS_EXTS : [ * const c_char ; 2 ] =
178+ [ surface:: NAME . as_ptr ( ) , ohos_surface:: NAME . as_ptr ( ) ] ;
179+ & OHOS_EXTS
180+ }
181+
168182 RawDisplayHandle :: AppKit ( _) | RawDisplayHandle :: UiKit ( _) => {
169183 const METAL_EXTS : [ * const c_char ; 2 ] =
170184 [ surface:: NAME . as_ptr ( ) , metal_surface:: NAME . as_ptr ( ) ] ;
0 commit comments