summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texcompress.c
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2016-02-11 12:29:53 -0800
committerAnuj Phogat <[email protected]>2016-05-03 03:43:18 -0700
commit63432eb37086b390650974a054f1fec32e660e7e (patch)
tree307e510c63a58dad7bf91d88e2abd3e48e3306e8 /src/mesa/main/texcompress.c
parent54cac7ad962c6f9f87009f0c59f14c370ee6c48a (diff)
mesa: Enable translation between astc 3d gl formats and mesa formats
Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/texcompress.c')
-rw-r--r--src/mesa/main/texcompress.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 3f453b1723a..9567c5ddab3 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -612,6 +612,46 @@ _mesa_glenum_to_compressed_format(GLenum format)
return MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x10;
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
return MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12;
+ case GL_COMPRESSED_RGBA_ASTC_3x3x3_OES:
+ return MESA_FORMAT_RGBA_ASTC_3x3x3;
+ case GL_COMPRESSED_RGBA_ASTC_4x3x3_OES:
+ return MESA_FORMAT_RGBA_ASTC_4x3x3;
+ case GL_COMPRESSED_RGBA_ASTC_4x4x3_OES:
+ return MESA_FORMAT_RGBA_ASTC_4x4x3;
+ case GL_COMPRESSED_RGBA_ASTC_4x4x4_OES:
+ return MESA_FORMAT_RGBA_ASTC_4x4x4;
+ case GL_COMPRESSED_RGBA_ASTC_5x4x4_OES:
+ return MESA_FORMAT_RGBA_ASTC_5x4x4;
+ case GL_COMPRESSED_RGBA_ASTC_5x5x4_OES:
+ return MESA_FORMAT_RGBA_ASTC_5x5x4;
+ case GL_COMPRESSED_RGBA_ASTC_5x5x5_OES:
+ return MESA_FORMAT_RGBA_ASTC_5x5x5;
+ case GL_COMPRESSED_RGBA_ASTC_6x5x5_OES:
+ return MESA_FORMAT_RGBA_ASTC_6x5x5;
+ case GL_COMPRESSED_RGBA_ASTC_6x6x5_OES:
+ return MESA_FORMAT_RGBA_ASTC_6x6x5;
+ case GL_COMPRESSED_RGBA_ASTC_6x6x6_OES:
+ return MESA_FORMAT_RGBA_ASTC_6x6x6;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_3x3x3;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x3x3;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x3;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x4;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x4x4;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x4;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x5;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x5x5;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x5;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES:
+ return MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x6;
default:
return MESA_FORMAT_NONE;
@@ -760,6 +800,46 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, mesa_format mesaFormat
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12:
return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
+ case MESA_FORMAT_RGBA_ASTC_3x3x3:
+ return GL_COMPRESSED_RGBA_ASTC_3x3x3_OES;
+ case MESA_FORMAT_RGBA_ASTC_4x3x3:
+ return GL_COMPRESSED_RGBA_ASTC_4x3x3_OES;
+ case MESA_FORMAT_RGBA_ASTC_4x4x3:
+ return GL_COMPRESSED_RGBA_ASTC_4x4x3_OES;
+ case MESA_FORMAT_RGBA_ASTC_4x4x4:
+ return GL_COMPRESSED_RGBA_ASTC_4x4x4_OES;
+ case MESA_FORMAT_RGBA_ASTC_5x4x4:
+ return GL_COMPRESSED_RGBA_ASTC_5x4x4_OES;
+ case MESA_FORMAT_RGBA_ASTC_5x5x4:
+ return GL_COMPRESSED_RGBA_ASTC_5x5x4_OES;
+ case MESA_FORMAT_RGBA_ASTC_5x5x5:
+ return GL_COMPRESSED_RGBA_ASTC_5x5x5_OES;
+ case MESA_FORMAT_RGBA_ASTC_6x5x5:
+ return GL_COMPRESSED_RGBA_ASTC_6x5x5_OES;
+ case MESA_FORMAT_RGBA_ASTC_6x6x5:
+ return GL_COMPRESSED_RGBA_ASTC_6x6x5_OES;
+ case MESA_FORMAT_RGBA_ASTC_6x6x6:
+ return GL_COMPRESSED_RGBA_ASTC_6x6x6_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_3x3x3:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x3x3:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x3:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x4:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x4x4:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x4:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x5:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x5x5:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x5:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x6:
+ return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES;
default:
_mesa_problem(ctx, "Unexpected mesa texture format in"
" _mesa_compressed_format_to_glenum()");