From 843a56324a388ca994f6f2150e8f0235c4830b1b Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 2 Dec 2020 17:18:21 +0100 Subject: [PATCH] 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 Part-of: --- 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 0e9554d..20bc1b1 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; -- 2.7.4