Mesa (master): lavapipe: set some basic usage-flags

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 3 11:54:43 UTC 2020


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Dec  2 17:18:21 2020 +0100

lavapipe: set some basic usage-flags

Setting these avoids a few warnings while running glxgears on Zink on
Lavapipe. There's a lot more flags to set here, but this is better than
nothing.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7879>

---

 src/gallium/frontends/lavapipe/lvp_image.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/gallium/frontends/lavapipe/lvp_image.c b/src/gallium/frontends/lavapipe/lvp_image.c
index 0e9554dc43c..20bc1b1c6ae 100644
--- a/src/gallium/frontends/lavapipe/lvp_image.c
+++ b/src/gallium/frontends/lavapipe/lvp_image.c
@@ -67,6 +67,12 @@ lvp_image_create(VkDevice _device,
          break;
       }
 
+      if (pCreateInfo->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
+         template.bind |= PIPE_BIND_RENDER_TARGET;
+
+      if (pCreateInfo->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
+         template.bind |= PIPE_BIND_DEPTH_STENCIL;
+
       template.format = vk_format_to_pipe(pCreateInfo->format);
       template.width0 = pCreateInfo->extent.width;
       template.height0 = pCreateInfo->extent.height;
@@ -249,6 +255,10 @@ VkResult lvp_CreateBuffer(
    {
       struct pipe_resource template;
       memset(&template, 0, sizeof(struct pipe_resource));
+
+      if (pCreateInfo->usage & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT)
+         template.bind |= PIPE_BIND_CONSTANT_BUFFER;
+
       template.screen = device->pscreen;
       template.target = PIPE_BUFFER;
       template.format = PIPE_FORMAT_R8_UNORM;



More information about the mesa-commit mailing list