mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 17:10:11 +01:00
tu: Fix CmdBindTransformFeedbackBuffersEXT size handling
According to the spec and as implemented by other drivers, this should
use the size of the buffer instead of the size of the VkDeviceMemory
it's bound to when VK_WHOLE_SIZE is specified or pSizes is NULL. The
current behavior doesn't make sense at all for sparse buffers which are
not bound to a single VkDeviceMemory. Just use the common helper that
already does the right thing, copied from anv.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
(cherry picked from commit 460ed35916)
This commit is contained in:
parent
06f02d2cd1
commit
1ce7aca953
2 changed files with 3 additions and 5 deletions
|
|
@ -974,7 +974,7 @@
|
|||
"description": "tu: Fix CmdBindTransformFeedbackBuffersEXT size handling",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -3892,12 +3892,10 @@ tu_CmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer,
|
|||
for (uint32_t i = 0; i < bindingCount; i++) {
|
||||
VK_FROM_HANDLE(tu_buffer, buf, pBuffers[i]);
|
||||
uint64_t iova = vk_buffer_address(&buf->vk, pOffsets[i]);
|
||||
uint32_t size = buf->bo->size - (iova - buf->bo->iova);
|
||||
uint32_t size = vk_buffer_range(&buf->vk, pOffsets[i],
|
||||
pSizes ? pSizes[i] : VK_WHOLE_SIZE);
|
||||
uint32_t idx = i + firstBinding;
|
||||
|
||||
if (pSizes && pSizes[i] != VK_WHOLE_SIZE)
|
||||
size = pSizes[i];
|
||||
|
||||
/* BUFFER_BASE is 32-byte aligned, add remaining offset to BUFFER_OFFSET */
|
||||
uint32_t offset = iova & 0x1f;
|
||||
iova &= ~(uint64_t) 0x1f;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue