mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 15:30:14 +01:00
radeonsi: Check if modifier supports the image extent
DCN only supports an extent < 4K on !64B && 128B. Signed-off-by: Joshua Ashton <joshua@froggi.es> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13056>
This commit is contained in:
parent
9cffe1b9ea
commit
baff748cb0
1 changed files with 13 additions and 1 deletions
|
|
@ -1384,6 +1384,18 @@ si_get_dmabuf_modifier_planes(struct pipe_screen *pscreen, uint64_t modifier,
|
|||
return planes;
|
||||
}
|
||||
|
||||
static bool
|
||||
si_modifier_supports_resource(struct pipe_screen *screen,
|
||||
uint64_t modifier,
|
||||
const struct pipe_resource *templ)
|
||||
{
|
||||
struct si_screen *sscreen = (struct si_screen *)screen;
|
||||
uint32_t max_width, max_height;
|
||||
|
||||
ac_modifier_max_extent(&sscreen->info, modifier, &max_width, &max_height);
|
||||
return templ->width0 <= max_width && templ->height0 <= max_height;
|
||||
}
|
||||
|
||||
static struct pipe_resource *
|
||||
si_texture_create_with_modifiers(struct pipe_screen *screen,
|
||||
const struct pipe_resource *templ,
|
||||
|
|
@ -1413,7 +1425,7 @@ si_texture_create_with_modifiers(struct pipe_screen *screen,
|
|||
for (int i = 0; i < allowed_mod_count; ++i) {
|
||||
bool found = false;
|
||||
for (int j = 0; j < modifier_count && !found; ++j)
|
||||
if (modifiers[j] == allowed_modifiers[i])
|
||||
if (modifiers[j] == allowed_modifiers[i] && si_modifier_supports_resource(screen, modifiers[j], templ))
|
||||
found = true;
|
||||
|
||||
if (found) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue