mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
zink: apply zink_resource_object::offset for memory flush/invalidates
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11437>
This commit is contained in:
parent
d80d9e1c93
commit
d574b0a51e
1 changed files with 2 additions and 2 deletions
|
|
@ -935,7 +935,7 @@ buffer_transfer_map(struct zink_context *ctx, struct zink_resource *res, unsigne
|
|||
#endif
|
||||
) {
|
||||
VkDeviceSize size = box->width;
|
||||
VkDeviceSize offset = trans->offset + box->x;
|
||||
VkDeviceSize offset = res->obj->offset + trans->offset + box->x;
|
||||
VkMappedMemoryRange range = init_mem_range(screen, res, offset, size);
|
||||
if (vkInvalidateMappedMemoryRanges(screen->dev, 1, &range) != VK_SUCCESS) {
|
||||
vkUnmapMemory(screen->dev, res->obj->mem);
|
||||
|
|
@ -1059,7 +1059,7 @@ zink_transfer_map(struct pipe_context *pctx,
|
|||
(box->x / desc->block.width) * (desc->block.bits / 8);
|
||||
if (!res->obj->coherent) {
|
||||
VkDeviceSize size = box->width * box->height * desc->block.bits / 8;
|
||||
VkMappedMemoryRange range = init_mem_range(screen, res, offset, size);
|
||||
VkMappedMemoryRange range = init_mem_range(screen, res, res->obj->offset + offset, size);
|
||||
vkFlushMappedMemoryRanges(screen->dev, 1, &range);
|
||||
}
|
||||
ptr = ((uint8_t *)base) + offset;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue