mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
zink: really fix direct image mapping offset (I mean it this time)
I got confused and: * used the vkformat instead of the pipe format for getting format description * incorrectly calculated bpp but this time it's definitely 100% fixed I promise Fixes:456b57802e("zink: fix direct image mapping offset") Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8074> (cherry picked from commitdfd0f042e0)
This commit is contained in:
parent
76870cfae2
commit
2ac5dec4f1
2 changed files with 3 additions and 3 deletions
|
|
@ -166,7 +166,7 @@
|
|||
"description": "zink: really fix direct image mapping offset (I mean it this time)",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "456b57802eaf95d36e7b950bdb5ffd86a1c0dc63"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -523,11 +523,11 @@ zink_transfer_map(struct pipe_context *pctx,
|
|||
vkGetImageSubresourceLayout(screen->dev, res->image, &isr, &srl);
|
||||
trans->base.stride = srl.rowPitch;
|
||||
trans->base.layer_stride = srl.arrayPitch;
|
||||
const struct util_format_description *desc = util_format_description(res->format);
|
||||
const struct util_format_description *desc = util_format_description(res->base.format);
|
||||
unsigned offset = srl.offset +
|
||||
box->z * srl.depthPitch +
|
||||
(box->y / desc->block.height) * srl.rowPitch +
|
||||
(box->x / desc->block.width) * (util_format_get_blocksize(res->format) / desc->nr_channels);
|
||||
(box->x / desc->block.width) * (desc->block.bits / 8);
|
||||
ptr = ((uint8_t *)ptr) + offset;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue