[Mesa-dev] [PATCH 14/15] anv: ignore VkSamplerYcbcrConversion on non-yuv formats
Tapani Pälli
tapani.palli at intel.com
Tue Nov 27 10:53:20 UTC 2018
This fulfills a requirement for clients that want to utilize same
code path for images with external formats (VK_FORMAT_UNDEFINED) and
"regular" RGBA images where format is known. This is similar to how
OES_EGL_image_external works.
To support this, we allow color conversion samplers for non-YUV
formats but skip setting up conversion when format does not have
can_ycbcr flag set.
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
src/intel/vulkan/genX_state.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c
index 42800a2581e..9b579d3118c 100644
--- a/src/intel/vulkan/genX_state.c
+++ b/src/intel/vulkan/genX_state.c
@@ -337,8 +337,11 @@ VkResult genX(CreateSampler)(
if (conversion == NULL)
break;
- sampler->n_planes = conversion->format->n_planes;
- sampler->conversion = conversion;
+ /* Setup conversion only if format is YUV format. */
+ if (conversion && conversion->format->can_ycbcr) {
+ sampler->n_planes = conversion->format->n_planes;
+ sampler->conversion = conversion;
+ }
break;
}
#if GEN_GEN >= 9
--
2.17.2
More information about the mesa-dev
mailing list