Add support for EXT_YUV_target
Add new sampler type "__samplerExternal2DY2YEXT"
to sample a YUV texture image and output color value
without any color conversion,
new additional type to specify color space standard formula and
built-in functions for yuv to rgb transformation.
Change-Id: I1780650fe84cd75191c1ca1e4118e89d585bfd92
Reviewed-on: https://chromium-review.googlesource.com/454697
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 6557501..b5a8b1e 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -73,6 +73,11 @@
return true;
}
+ if (type.getQualifier() == EvqFragmentOut && layoutQualifier.yuv == true)
+ {
+ return true;
+ }
+
if (IsOpaqueType(type.getBasicType()) && layoutQualifier.binding != -1)
{
return true;
@@ -214,6 +219,14 @@
}
}
+ if (type.getQualifier() == EvqFragmentOut)
+ {
+ if (layoutQualifier.yuv == true)
+ {
+ out << listItemPrefix << "yuv";
+ }
+ }
+
if (IsOpaqueType(type.getBasicType()))
{
if (layoutQualifier.binding >= 0)
@@ -414,6 +427,9 @@
case EbtBool:
out << pConstUnion->getBConst();
break;
+ case EbtYuvCscStandardEXT:
+ out << getYuvCscStandardEXTString(pConstUnion->getYuvCscStandardEXTConst());
+ break;
default:
UNREACHABLE();
}