diff options
author | Bas Nieuwenhuizen <[email protected]> | 2020-04-28 00:40:12 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-28 11:16:03 +0000 |
commit | 8e03cf15f9516642ba7f7cd7b7a2d7aad835796a (patch) | |
tree | 94ba829356cb7c5e69e120e167825ff24f1a4eec | |
parent | 6747a984f59ea9a2dd74b98d59cb8fdb028969ae (diff) |
radeonsi: Count planes for imported textures.
For the DRI2 lowered YUV import separate pipe_resources get created
but in the end the first resource just gets asked for NPLANES.
Since
1) (Almost) everything uses the first resource + a plane index in the
Gallium interface.
2) This mirrors non-imported textures.
lets fix this in the driver.
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4779>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_texture.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index db470457551..6b4ff99b089 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1659,6 +1659,15 @@ static struct pipe_resource *si_texture_from_winsys_buffer(struct si_screen *ssc tex->buffer.external_usage = usage; tex->num_planes = 1; + /* Account for multiple planes with lowered yuv import. */ + struct pipe_resource *next_plane = tex->buffer.b.b.next; + while(next_plane) { + struct si_texture *next_tex = (struct si_texture *)next_plane; + ++next_tex->num_planes; + ++tex->num_planes; + next_plane = next_plane->next; + } + if (!si_read_tex_bo_metadata(sscreen, tex, offset, &metadata)) { si_texture_reference(&tex, NULL); return NULL; |