mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
lavapipe: use resource get param.
This uses the resource get param to get proper values for image subresource layouts. Fixes: dEQP-VK.image.subresource_layout* Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6639>
This commit is contained in:
parent
2dcc9c7f54
commit
b6a0309f48
1 changed files with 41 additions and 7 deletions
|
|
@ -167,14 +167,48 @@ void lvp_GetImageSubresourceLayout(
|
|||
{
|
||||
LVP_FROM_HANDLE(lvp_device, device, _device);
|
||||
LVP_FROM_HANDLE(lvp_image, image, _image);
|
||||
uint32_t stride, offset;
|
||||
device->pscreen->resource_get_info(device->pscreen,
|
||||
image->bo,
|
||||
&stride, &offset);
|
||||
pLayout->offset = offset;
|
||||
pLayout->rowPitch = stride;
|
||||
pLayout->arrayPitch = 0;
|
||||
uint64_t value;
|
||||
|
||||
device->pscreen->resource_get_param(device->pscreen,
|
||||
NULL,
|
||||
image->bo,
|
||||
0,
|
||||
pSubresource->arrayLayer,
|
||||
pSubresource->mipLevel,
|
||||
PIPE_RESOURCE_PARAM_STRIDE,
|
||||
0, &value);
|
||||
|
||||
pLayout->rowPitch = value;
|
||||
|
||||
device->pscreen->resource_get_param(device->pscreen,
|
||||
NULL,
|
||||
image->bo,
|
||||
0,
|
||||
pSubresource->arrayLayer,
|
||||
pSubresource->mipLevel,
|
||||
PIPE_RESOURCE_PARAM_OFFSET,
|
||||
0, &value);
|
||||
|
||||
pLayout->offset = value;
|
||||
|
||||
device->pscreen->resource_get_param(device->pscreen,
|
||||
NULL,
|
||||
image->bo,
|
||||
0,
|
||||
pSubresource->arrayLayer,
|
||||
pSubresource->mipLevel,
|
||||
PIPE_RESOURCE_PARAM_LAYER_STRIDE,
|
||||
0, &value);
|
||||
|
||||
if (image->bo->target == PIPE_TEXTURE_3D) {
|
||||
pLayout->depthPitch = value;
|
||||
pLayout->arrayPitch = 0;
|
||||
} else {
|
||||
pLayout->depthPitch = 0;
|
||||
pLayout->arrayPitch = value;
|
||||
}
|
||||
pLayout->size = image->size;
|
||||
|
||||
switch (pSubresource->aspectMask) {
|
||||
case VK_IMAGE_ASPECT_COLOR_BIT:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue