mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
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>
(cherry picked from commit b13e2a495e)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:
parent
acc1e9efab
commit
e791098f2e
2 changed files with 18 additions and 1 deletions
|
|
@ -2134,7 +2134,7 @@
|
||||||
"description": "svga: add svga_resource_create_with_modifiers() function",
|
"description": "svga: add svga_resource_create_with_modifiers() function",
|
||||||
"nominated": false,
|
"nominated": false,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 4,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null,
|
"because_sha": null,
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -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
|
* Check if a resource (texture, buffer) of the given size
|
||||||
* and format can be created.
|
* and format can be created.
|
||||||
|
|
@ -121,6 +137,7 @@ void
|
||||||
svga_init_screen_resource_functions(struct svga_screen *is)
|
svga_init_screen_resource_functions(struct svga_screen *is)
|
||||||
{
|
{
|
||||||
is->screen.resource_create = svga_resource_create;
|
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_from_handle = svga_resource_from_handle;
|
||||||
is->screen.resource_get_handle = svga_resource_get_handle;
|
is->screen.resource_get_handle = svga_resource_get_handle;
|
||||||
is->screen.resource_destroy = svga_resource_destroy;
|
is->screen.resource_destroy = svga_resource_destroy;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue