vl: Don't check npot textures support when creating buffers

This is the only place where PIPE_VIDEO_CAP_NPOT_TEXTURES is used,
but all video drivers supports npot textures.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40644>
This commit is contained in:
David Rosca 2026-03-26 11:08:10 +01:00 committed by Marge Bot
parent 16a2aeeb93
commit b91ad4a4e5

View file

@ -390,26 +390,15 @@ vl_video_buffer_create(struct pipe_context *pipe,
{
enum pipe_format resource_formats[VL_NUM_COMPONENTS];
struct pipe_video_buffer templat, *result;
bool pot_buffers;
assert(pipe);
assert(tmpl->width > 0 && tmpl->height > 0);
pot_buffers = !pipe->screen->get_video_param
(
pipe->screen,
PIPE_VIDEO_PROFILE_UNKNOWN,
PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
PIPE_VIDEO_CAP_NPOT_TEXTURES
);
vl_get_video_buffer_formats(pipe->screen, tmpl->buffer_format, resource_formats);
templat = *tmpl;
templat.width = pot_buffers ? util_next_power_of_two(tmpl->width)
: align(tmpl->width, VL_MACROBLOCK_WIDTH);
templat.height = pot_buffers ? util_next_power_of_two(tmpl->height)
: align(tmpl->height, VL_MACROBLOCK_HEIGHT);
templat.width = align(tmpl->width, VL_MACROBLOCK_WIDTH);
templat.height = align(tmpl->height, VL_MACROBLOCK_HEIGHT);
if (tmpl->interlaced)
templat.height /= 2;