mesa: Modify format validation to check for extension not context version
authorPi Tabred <servuswiegehtz@yahoo.de>
Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 18 Dec 2013 16:06:51 +0000 (09:06 -0700)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/teximage.c

index 0d436b2fb219094040b899f55180dfbaa729f4e0..f92dc1a6932f0932c822a45392897c716c7a6dad 100644 (file)
@@ -4054,15 +4054,10 @@ _mesa_validate_texbuffer_format(const struct gl_context *ctx,
    if (datatype == GL_HALF_FLOAT && !ctx->Extensions.ARB_half_float_pixel)
       return MESA_FORMAT_NONE;
 
-   /* The GL_ARB_texture_rg and GL_ARB_texture_buffer_object specs don't make
-    * any mention of R/RG formats, but they appear in the GL 3.1 core
-    * specification.
-    */
-   if (ctx->Version <= 30) {
+   if (!ctx->Extensions.ARB_texture_rg) {
       GLenum base_format = _mesa_get_format_base_format(format);
-
       if (base_format == GL_R || base_format == GL_RG)
-        return MESA_FORMAT_NONE;
+         return MESA_FORMAT_NONE;
    }
 
    if (!ctx->Extensions.ARB_texture_buffer_object_rgb32) {