File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -761,9 +761,19 @@ impl super::Device {
761761 let image =
762762 self . create_image_without_memory ( desc, Some ( & mut external_memory_image_info) ) ?;
763763
764+ // Some external memory types require dedicated allocation
765+ // https://docs.vulkan.org/guide/latest/extensions/external.html#_importing_memory
766+ let mut dedicated_allocate_info =
767+ vk:: MemoryDedicatedAllocateInfo :: default ( ) . image ( image. raw ) ;
768+
764769 let mut import_memory_info = vk:: ImportMemoryWin32HandleInfoKHR :: default ( )
765770 . handle_type ( vk:: ExternalMemoryHandleTypeFlags :: D3D11_TEXTURE )
766771 . handle ( d3d11_shared_handle. 0 as _ ) ;
772+ // TODO: We should use `push_next` instead, but currently ash does not provide this method for the `ImportMemoryWin32HandleInfoKHR` type.
773+ #[ allow( clippy:: unnecessary_mut_passed) ]
774+ {
775+ import_memory_info. p_next = <* const _ >:: cast ( & mut dedicated_allocate_info) ;
776+ }
767777
768778 let mem_type_index = self
769779 . find_memory_type_index (
You can’t perform that action at this time.
0 commit comments