gl-render: Set default color hints for EGL images

In order to be consistent with our internal YUV shader and KMS plane
output. Note that the extension requires the hints to be ignored for
RGB formats.

Note that the attribs array previously was slightly larger than the
maximum number of attributes required.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
This commit is contained in:
Robert Mader 2025-01-22 16:29:05 +01:00 committed by Daniel Stone
parent ce79976dfc
commit 1b7462011d

View file

@ -3219,7 +3219,7 @@ static EGLImageKHR
import_simple_dmabuf(struct gl_renderer *gr,
const struct dmabuf_attributes *attributes)
{
EGLint attribs[52];
EGLint attribs[53];
int atti = 0;
bool has_modifier;
@ -3308,6 +3308,12 @@ import_simple_dmabuf(struct gl_renderer *gr,
}
}
attribs[atti++] = EGL_YUV_COLOR_SPACE_HINT_EXT;
attribs[atti++] = EGL_ITU_REC601_EXT;
attribs[atti++] = EGL_SAMPLE_RANGE_HINT_EXT;
attribs[atti++] = EGL_YUV_NARROW_RANGE_EXT;
attribs[atti++] = EGL_NONE;
return gr->create_image(gr->egl_display, EGL_NO_CONTEXT,