| 933 | } |
| 934 | |
| 935 | VkResult 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 | } |
| 967 | VkResult 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)); |
nothing calls this directly
no test coverage detected