mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-18 06:59:44 -05:00
Merge branch 'bt709' into 'master'
Consistently use BT.709 encoding for YUV->RGB See merge request wlroots/wlroots!5067
This commit is contained in:
commit
e55bf74acc
6 changed files with 56 additions and 5 deletions
|
|
@ -747,7 +747,7 @@ EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
|
|||
}
|
||||
|
||||
unsigned int atti = 0;
|
||||
EGLint attribs[50];
|
||||
EGLint attribs[52];
|
||||
attribs[atti++] = EGL_WIDTH;
|
||||
attribs[atti++] = attributes->width;
|
||||
attribs[atti++] = EGL_HEIGHT;
|
||||
|
|
@ -805,6 +805,13 @@ EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
|
|||
}
|
||||
}
|
||||
|
||||
// Always convert YUV to RGB using BT.709 color encoding. This is to
|
||||
// attempt to be consistent across GL drivers, and also to be
|
||||
// consistent with DRM scanout so there's no color-shift when direct
|
||||
// scanout is enabled/disabled.
|
||||
attribs[atti++] = EGL_YUV_COLOR_SPACE_HINT_EXT;
|
||||
attribs[atti++] = EGL_ITU_REC709_EXT;
|
||||
|
||||
// Our clients don't expect our usage to trash the buffer contents
|
||||
attribs[atti++] = EGL_IMAGE_PRESERVED_KHR;
|
||||
attribs[atti++] = EGL_TRUE;
|
||||
|
|
|
|||
|
|
@ -1990,7 +1990,7 @@ struct wlr_vk_pipeline_layout *get_or_create_pipeline_layout(
|
|||
VkSamplerYcbcrConversionCreateInfo conversion_create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO,
|
||||
.format = key->ycbcr_format->vk,
|
||||
.ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601,
|
||||
.ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709,
|
||||
.ycbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW,
|
||||
.xChromaOffset = VK_CHROMA_LOCATION_MIDPOINT,
|
||||
.yChromaOffset = VK_CHROMA_LOCATION_MIDPOINT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue