Skip to content

venus: suggest the proper sampler ycbcr model conversion based on format

Yiwei Zhang requested to merge zzyiwei/mesa:sampler-ycbcr into main

When the app uses RGB* formats along with VkExternalFormatANDROID with immutable sampler, at least we can suggest VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY.

From the spec:

Implementations may not always be able to determine the color model, numerical range, or chroma offsets of the image contents, so the values in VkAndroidHardwareBufferFormatPropertiesANDROID are only suggestions. Applications should treat these values as sensible defaults to use in the absence of more reliable information obtained through some other means. If the underlying physical device is also usable via OpenGL ES with the GL_OES_EGL_image_external extension, the implementation should suggest values that will produce similar sampled values as would be obtained by sampling the same external image via samplerExternalOES in OpenGL ES using equivalent sampler parameters.

We are not required and probably couldn't do better here.

Test: android.graphics.cts.BasicVulkanGpuTest passes without any other regressions

/cc @olv @ryanneph

Merge request reports