[Mesa-dev] [V2 15/19] mesa: Account for astc 3d formats in _mesa_is_astc_format()

Anuj Phogat anuj.phogat at gmail.com
Mon Mar 21 21:04:09 UTC 2016


Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 src/mesa/main/glformats.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index edcafdc..7245f66 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -823,10 +823,10 @@ _mesa_is_enum_format_signed_int(GLenum format)
 }
 
 /**
- * Test if the given format is an ASTC format.
+ * Test if the given format is an ASTC 2D format.
  */
-GLboolean
-_mesa_is_astc_format(GLenum internalFormat)
+static bool
+is_astc_2d_format(GLenum internalFormat)
 {
    switch (internalFormat) {
    case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
@@ -897,6 +897,16 @@ is_astc_3d_format(GLenum internalFormat)
 }
 
 /**
+ * Test if the given format is an ASTC format.
+ */
+GLboolean
+_mesa_is_astc_format(GLenum internalFormat)
+{
+   return is_astc_2d_format(internalFormat) ||
+          is_astc_3d_format(internalFormat);
+}
+
+/**
  * Test if the given format is an integer (non-normalized) format.
  */
 GLboolean
-- 
2.5.0



More information about the mesa-dev mailing list