mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
radeonsi: Set multi plane format also for imported textures
multi_plane_format is used to correctly copy all planes for staging texture
copies, otherwise only the first plane gets copied.
It's now also used in si_video_dec, which doesn't work when decoding into
imported surfaces if multi_plane_format is not set.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15232
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 3dbbd94ffd)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
This commit is contained in:
parent
599bb79ff4
commit
5447f81cc5
2 changed files with 14 additions and 4 deletions
|
|
@ -3084,7 +3084,7 @@
|
|||
"description": "radeonsi: Set multi plane format also for imported textures",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1931,6 +1931,7 @@ static struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen,
|
|||
{
|
||||
struct si_screen *sscreen = (struct si_screen *)screen;
|
||||
struct pb_buffer_lean *buf = NULL;
|
||||
unsigned format_num_planes = util_format_get_num_planes(whandle->format);
|
||||
|
||||
buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle,
|
||||
sscreen->info.max_alignment,
|
||||
|
|
@ -1941,7 +1942,7 @@ static struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen,
|
|||
if (templ->target == PIPE_BUFFER)
|
||||
return si_buffer_from_winsys_buffer(screen, templ, buf, 0, true);
|
||||
|
||||
if (whandle->plane >= util_format_get_num_planes(whandle->format)) {
|
||||
if (whandle->plane >= format_num_planes) {
|
||||
struct si_auxiliary_texture *tex = CALLOC_STRUCT_CL(si_auxiliary_texture);
|
||||
if (!tex)
|
||||
return NULL;
|
||||
|
|
@ -1956,8 +1957,17 @@ static struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen,
|
|||
return &tex->b.b;
|
||||
}
|
||||
|
||||
return si_texture_from_winsys_buffer(sscreen, templ, buf, whandle->stride, whandle->offset,
|
||||
whandle->modifier, usage, true, true);
|
||||
struct pipe_resource *texture =
|
||||
si_texture_from_winsys_buffer(sscreen, templ, buf, whandle->stride, whandle->offset,
|
||||
whandle->modifier, usage, true, true);
|
||||
|
||||
if (texture && whandle->plane == 0 && format_num_planes >= 2) {
|
||||
struct si_texture *tex = (struct si_texture *)texture;
|
||||
|
||||
tex->multi_plane_format = whandle->format;
|
||||
}
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
bool si_init_flushed_depth_texture(struct pipe_context *ctx, struct pipe_resource *texture)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue