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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user