mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
radv: bind aliased wsi image at memory offset zero
This aligns with common wsi, and also obeys dedicated alloc requirement. Fixes:825c05a7e8("radv: adopt wsi_common_get_memory") Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37152> (cherry picked from commit94d8a4a465)
This commit is contained in:
parent
dda8f9f519
commit
8dc2746a84
2 changed files with 5 additions and 4 deletions
|
|
@ -9934,7 +9934,7 @@
|
|||
"description": "radv: bind aliased wsi image at memory offset zero",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "825c05a7e8f89548c0400cf920f3f70fcfa64060",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1806,6 +1806,7 @@ radv_BindImageMemory2(VkDevice _device, uint32_t bindInfoCount, const VkBindImag
|
|||
for (uint32_t i = 0; i < bindInfoCount; ++i) {
|
||||
VK_FROM_HANDLE(radv_device_memory, mem, pBindInfos[i].memory);
|
||||
VK_FROM_HANDLE(radv_image, image, pBindInfos[i].image);
|
||||
uint64_t offset = pBindInfos[i].memoryOffset;
|
||||
VkBindMemoryStatus *status = (void *)vk_find_struct_const(&pBindInfos[i], BIND_MEMORY_STATUS);
|
||||
|
||||
if (status)
|
||||
|
|
@ -1819,6 +1820,7 @@ radv_BindImageMemory2(VkDevice _device, uint32_t bindInfoCount, const VkBindImag
|
|||
assert(swapchain_info && swapchain_info->swapchain != VK_NULL_HANDLE);
|
||||
mem = radv_device_memory_from_handle(
|
||||
wsi_common_get_memory(swapchain_info->swapchain, swapchain_info->imageIndex));
|
||||
offset = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1846,7 +1848,7 @@ radv_BindImageMemory2(VkDevice _device, uint32_t bindInfoCount, const VkBindImag
|
|||
radv_GetImageMemoryRequirements2(_device, &info, &reqs);
|
||||
|
||||
if (mem->alloc_size) {
|
||||
if (pBindInfos[i].memoryOffset + reqs.memoryRequirements.size > mem->alloc_size) {
|
||||
if (offset + reqs.memoryRequirements.size > mem->alloc_size) {
|
||||
if (status)
|
||||
*status->pResult = VK_ERROR_UNKNOWN;
|
||||
return vk_errorf(device, VK_ERROR_UNKNOWN, "Device memory object too small for the image.\n");
|
||||
|
|
@ -1855,8 +1857,7 @@ radv_BindImageMemory2(VkDevice _device, uint32_t bindInfoCount, const VkBindImag
|
|||
|
||||
const uint64_t addr = radv_buffer_get_va(mem->bo);
|
||||
|
||||
radv_bind_image_memory(device, image, bind_idx, mem->bo, addr, pBindInfos[i].memoryOffset,
|
||||
reqs.memoryRequirements.size);
|
||||
radv_bind_image_memory(device, image, bind_idx, mem->bo, addr, offset, reqs.memoryRequirements.size);
|
||||
}
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue