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> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40817>
This commit is contained in:
parent
363447b7d0
commit
3dbbd94ffd
1 changed files with 13 additions and 3 deletions
|
|
@ -1928,6 +1928,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,
|
||||
|
|
@ -1938,7 +1939,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;
|
||||
|
|
@ -1953,8 +1954,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