mirror of
https://github.com/opus-tango/IntroductionToVulkan.git
synced 2026-03-20 12:05:20 +00:00
Use the parameter of the image handle to allocate memory.
The original code will use Vulkan.Image.Handle to query the requirement of the image to be allocated memory, which is unreasonable, since the handle for the image has been given as the parameter "image" already. When reuse this function to create other images, the program would crash in the driver side for this reason.
This commit is contained in:
@@ -242,7 +242,7 @@ namespace ApiWithoutSecrets {
|
||||
|
||||
bool Tutorial06::AllocateImageMemory( VkImage image, VkMemoryPropertyFlagBits property, VkDeviceMemory *memory ) {
|
||||
VkMemoryRequirements image_memory_requirements;
|
||||
vkGetImageMemoryRequirements( GetDevice(), Vulkan.Image.Handle, &image_memory_requirements );
|
||||
vkGetImageMemoryRequirements( GetDevice(), image, &image_memory_requirements );
|
||||
|
||||
VkPhysicalDeviceMemoryProperties memory_properties;
|
||||
vkGetPhysicalDeviceMemoryProperties( GetPhysicalDevice(), &memory_properties );
|
||||
@@ -1219,4 +1219,4 @@ namespace ApiWithoutSecrets {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ApiWithoutSecrets
|
||||
} // namespace ApiWithoutSecrets
|
||||
|
||||
Reference in New Issue
Block a user