File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -699,8 +699,8 @@ impl super::Device {
699699 #[ cfg( windows) ]
700700 fn find_memory_type_index (
701701 & self ,
702- type_bits : u32 ,
703- flags : vk:: MemoryPropertyFlags ,
702+ type_bits_req : u32 ,
703+ flags_req : vk:: MemoryPropertyFlags ,
704704 ) -> Option < usize > {
705705 let mem_properties = unsafe {
706706 self . shared
@@ -711,7 +711,10 @@ impl super::Device {
711711
712712 // https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceMemoryProperties.html
713713 for ( i, mem_ty) in mem_properties. memory_types_as_slice ( ) . iter ( ) . enumerate ( ) {
714- if type_bits & ( 1 << i) != 0 && mem_ty. property_flags & flags == flags {
714+ let types_bits = 1 << i;
715+ let is_required_memory_type = type_bits_req & types_bits != 0 ;
716+ let has_required_properties = mem_ty. property_flags & flags_req == flags_req;
717+ if is_required_memory_type && has_required_properties {
715718 return Some ( i) ;
716719 }
717720 }
You can’t perform that action at this time.
0 commit comments