dri2: Allow allocating suboptimal for sampling

Fixes allocations via gbm, which doesn't necessarily need to be
renderable.

Fixes: ba7454a155 ("dri2+gallium: Support to import suboptimal formats")
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36081>
This commit is contained in:
Rob Clark 2025-07-09 15:28:22 -07:00 committed by Marge Bot
parent a1cd9f917f
commit 3fcf63f364

View file

@ -919,8 +919,10 @@ dri_create_image(struct dri_screen *screen,
if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target,
0, 0, PIPE_BIND_RENDER_TARGET))
tex_usage |= PIPE_BIND_RENDER_TARGET;
if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target,
0, 0, PIPE_BIND_SAMPLER_VIEW))
if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target, 0, 0,
PIPE_BIND_SAMPLER_VIEW) ||
pscreen->is_format_supported(pscreen, map->pipe_format, screen->target, 0, 0,
PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SAMPLER_VIEW_SUBOPTIMAL))
tex_usage |= PIPE_BIND_SAMPLER_VIEW;
if (!tex_usage)