Implement support for YV12 texture sampling.
Bug 21572252
Change-Id: Iaf54b4d960dbc243c40f981e1c73c199481e2d28
Reviewed-on: https://swiftshader-review.googlesource.com/3930
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/common/Image.cpp b/src/OpenGL/common/Image.cpp
index 691e77e..78122d2 100644
--- a/src/OpenGL/common/Image.cpp
+++ b/src/OpenGL/common/Image.cpp
@@ -470,6 +470,18 @@
{
return sw::FORMAT_A8;
}
+ else if(format == SW_YV12_BT601)
+ {
+ return sw::FORMAT_YV12_BT601;
+ }
+ else if(format == SW_YV12_BT709)
+ {
+ return sw::FORMAT_YV12_BT709;
+ }
+ else if(format == SW_YV12_JFIF)
+ {
+ return sw::FORMAT_YV12_JFIF;
+ }
else UNREACHABLE(format);
}
else if(type == GL_UNSIGNED_SHORT || type == GL_UNSIGNED_INT)
@@ -506,7 +518,7 @@
}
// Returns the size, in bytes, of a single texel in an Image
- int ComputePixelSize(GLenum format, GLenum type)
+ static int ComputePixelSize(GLenum format, GLenum type)
{
switch(type)
{