MCPcopy Create free account
hub / github.com/crosire/reshade / VKAPI_CALL vkBindImageMemory

Function VKAPI_CALL vkBindImageMemory

source/vulkan/vulkan_hooks_device.cpp:935–966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933}
934
935VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset)
936{
937 reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
938 RESHADE_VULKAN_GET_DEVICE_DISPATCH_PTR(BindImageMemory, device_impl);
939
940 const VkResult result = trampoline(device, image, memory, memoryOffset);
941 if (result < VK_SUCCESS)
942 {
943#if RESHADE_VERBOSE_LOG
944 reshade::log::message(reshade::log::level::warning, "vkBindImageMemory failed with error code %d.", static_cast<int>(result));
945#endif
946 return result;
947 }
948
949#if RESHADE_ADDON
950 const auto image_data = device_impl->get_private_data_for_object<VK_OBJECT_TYPE_IMAGE>(image);
951 image_data->memory = memory;
952 image_data->memory_offset = memoryOffset;
953
954 reshade::invoke_addon_event<reshade::addon_event::init_resource>(
955 device_impl,
956 reshade::vulkan::convert_resource_desc(image_data->create_info),
957 nullptr,
958 image_data->create_info.initialLayout == VK_IMAGE_LAYOUT_PREINITIALIZED ? reshade::api::resource_usage::cpu_access : reshade::api::resource_usage::undefined,
959 reshade::api::resource { (uint64_t)image });
960
961 // Create default view after the 'init_resource' event, so that the image is known to add-ons (since it calls 'init_resource_view' internally)
962 create_default_view(device_impl, image);
963#endif
964
965 return result;
966}
967VkResult VKAPI_CALL vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos)
968{
969 reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));

Callers

nothing calls this directly

Calls 5

dispatch_key_from_handleFunction · 0.85
messageFunction · 0.85
convert_resource_descFunction · 0.85
create_default_viewFunction · 0.85
atMethod · 0.80

Tested by

no test coverage detected