Mesa (master): lavapipe: use resource get param.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 2 23:10:35 UTC 2020


Module: Mesa
Branch: master
Commit: b6a0309f482da368ea252808d2de44eef54556c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6a0309f482da368ea252808d2de44eef54556c8

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Sep  8 09:02:15 2020 +1000

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 at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6639>

---

 src/gallium/frontends/lavapipe/lvp_image.c | 48 +++++++++++++++++++++++++-----
 1 file changed, 41 insertions(+), 7 deletions(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_image.c b/src/gallium/frontends/lavapipe/lvp_image.c
index 39c63aa1b05..d8569f12223 100644
--- a/src/gallium/frontends/lavapipe/lvp_image.c
+++ b/src/gallium/frontends/lavapipe/lvp_image.c
@@ -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;



More information about the mesa-commit mailing list