56 lines
2.1 KiB
Diff
56 lines
2.1 KiB
Diff
From b13e2a495e9e3da56add7d852ca01b2cd7eef52d Mon Sep 17 00:00:00 2001
|
|
From: Brian Paul <brian.paul@broadcom.com>
|
|
Date: Thu, 9 Jan 2025 22:45:34 -0700
|
|
Subject: [PATCH] svga: add svga_resource_create_with_modifiers() function
|
|
|
|
The dri_create_image() function returns early if the gallium
|
|
driver does not implement this function. Surface creation has
|
|
been broken for some time up to this fix.
|
|
|
|
Signed-off-by: Brian Paul <brian.paul@broadcom.com>
|
|
Reviewed-by: Neha Bhende <neha.Bhende@broadcom.com>
|
|
Reviewed-by: Neha Bhende <None>
|
|
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32976>
|
|
---
|
|
src/gallium/drivers/svga/svga_resource.c | 17 +++++++++++++++++
|
|
1 file changed, 17 insertions(+)
|
|
|
|
diff --git a/src/gallium/drivers/svga/svga_resource.c b/src/gallium/drivers/svga/svga_resource.c
|
|
index 80a4311854e..1775b65fab1 100644
|
|
--- a/src/gallium/drivers/svga/svga_resource.c
|
|
+++ b/src/gallium/drivers/svga/svga_resource.c
|
|
@@ -52,6 +52,22 @@ svga_resource_from_handle(struct pipe_screen * screen,
|
|
}
|
|
|
|
|
|
+static struct pipe_resource *
|
|
+svga_resource_create_with_modifiers(struct pipe_screen *screen,
|
|
+ const struct pipe_resource *templat,
|
|
+ const uint64_t *modifiers, int count)
|
|
+{
|
|
+ /* Not sure, but it seems there's no format modifiers
|
|
+ * to deal with here.
|
|
+ */
|
|
+ if (count > 0 && modifiers != NULL && modifiers[0] != 0) {
|
|
+ debug_printf("vmware: unexpected format modifier 0x%lx\n",
|
|
+ modifiers[0]);
|
|
+ }
|
|
+ return svga_resource_create(screen, templat);
|
|
+}
|
|
+
|
|
+
|
|
/**
|
|
* Check if a resource (texture, buffer) of the given size
|
|
* and format can be created.
|
|
@@ -121,6 +137,7 @@ void
|
|
svga_init_screen_resource_functions(struct svga_screen *is)
|
|
{
|
|
is->screen.resource_create = svga_resource_create;
|
|
+ is->screen.resource_create_with_modifiers = svga_resource_create_with_modifiers;
|
|
is->screen.resource_from_handle = svga_resource_from_handle;
|
|
is->screen.resource_get_handle = svga_resource_get_handle;
|
|
is->screen.resource_destroy = svga_resource_destroy;
|
|
--
|
|
2.43.0
|
|
|