mesa: GL_ARB_half_float_pixel is not optional
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 13 Jan 2014 23:23:48 +0000 (15:23 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 11 Feb 2014 22:36:43 +0000 (14:36 -0800)
Almost every driver already supported it.  All current and future
Gallium drivers always support it, and most existing classic drivers
support it.

This only changes radeon and nouveau.

This extension only adds data types that can be passed to, for example,
glTexImage2D.  It does not add internal formats.  Since you can already
pass GL_FLOAT to glTexImage2D this shouldn't pose any additional issues
with those drivers.  Note that r200 and i915 already supported this
extension, and they don't support floating-point textures either.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
docs/GL3.txt
src/mesa/drivers/dri/i915/intel_extensions.c
src/mesa/drivers/dri/i965/intel_extensions.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/main/extensions.c
src/mesa/main/glformats.c
src/mesa/main/mtypes.h
src/mesa/main/teximage.c
src/mesa/main/version.c
src/mesa/state_tracker/st_extensions.c

index c678e4ad794d726ed181a2c793062aa65533e6c8..06ce417af47a5faff43e50acc7f38a7184f931e1 100644 (file)
@@ -30,7 +30,7 @@ GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi
   GL_EXT_texture_shared_exponent                        DONE (swrast)
   Float depth buffers (GL_ARB_depth_buffer_float)       DONE ()
   Framebuffer objects (GL_ARB_framebuffer_object)       DONE (r300, swrast)
-  GL_ARB_half_float_pixel                               DONE (r300, swrast)
+  GL_ARB_half_float_pixel                               DONE (all drivers)
   GL_ARB_half_float_vertex                              DONE (r300, swrast)
   GL_EXT_texture_integer                                DONE ()
   GL_EXT_texture_array                                  DONE ()
index 9da12dc0efc2fb3eb3fbdb4f293eb26c07825242..11be0045e377d7a2935e0e57e9956a27d78758fa 100644 (file)
@@ -47,7 +47,6 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.ARB_draw_elements_base_vertex = true;
    ctx->Extensions.ARB_explicit_attrib_location = true;
    ctx->Extensions.ARB_framebuffer_object = true;
-   ctx->Extensions.ARB_half_float_pixel = true;
    ctx->Extensions.ARB_internalformat_query = true;
    ctx->Extensions.ARB_map_buffer_range = true;
    ctx->Extensions.ARB_point_sprite = true;
index eb3f2c7d0876bc81221218081dceaa77878a9112..ef9aa555ec23d95f121229008e745e12e33d352b 100644 (file)
@@ -174,7 +174,6 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.ARB_fragment_program_shadow = true;
    ctx->Extensions.ARB_fragment_shader = true;
    ctx->Extensions.ARB_framebuffer_object = true;
-   ctx->Extensions.ARB_half_float_pixel = true;
    ctx->Extensions.ARB_half_float_vertex = true;
    ctx->Extensions.ARB_instanced_arrays = true;
    ctx->Extensions.ARB_internalformat_query = true;
index 0043090f1a4a5ccc0a03298d5f0ed5957554ee2a..71dfcf337f054839fdb4baa2c0343dfe6cb6ef5a 100644 (file)
@@ -366,7 +366,6 @@ GLboolean r200CreateContext( gl_api api,
    _math_matrix_ctr( &rmesa->tmpmat );
    _math_matrix_set_identity( &rmesa->tmpmat );
 
-   ctx->Extensions.ARB_half_float_pixel = true;
    ctx->Extensions.ARB_occlusion_query = true;
    ctx->Extensions.ARB_point_sprite = true;
    ctx->Extensions.ARB_texture_border_clamp = true;
index 5f741fbd2ec6354a7c50ba93f5c5b83c7e8748e3..bc63b26dbaa7a0942b436bd5365612a3b6f02642 100644 (file)
@@ -106,7 +106,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_framebuffer_sRGB",                    o(EXT_framebuffer_sRGB),                    GL,             1998 },
    { "GL_ARB_get_program_binary",                  o(dummy_true),                              GL,             2010 },
    { "GL_ARB_gpu_shader5",                         o(ARB_gpu_shader5),                         GL,             2010 },
-   { "GL_ARB_half_float_pixel",                    o(ARB_half_float_pixel),                    GL,             2003 },
+   { "GL_ARB_half_float_pixel",                    o(dummy_true),                              GL,             2003 },
    { "GL_ARB_half_float_vertex",                   o(ARB_half_float_vertex),                   GL,             2008 },
    { "GL_ARB_instanced_arrays",                    o(ARB_instanced_arrays),                    GL,             2008 },
    { "GL_ARB_internalformat_query",                o(ARB_internalformat_query),                GL,             2011 },
@@ -401,7 +401,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
    ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
    ctx->Extensions.ARB_fragment_shader = GL_TRUE;
    ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
-   ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
    ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
    ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
    ctx->Extensions.ARB_occlusion_query = GL_TRUE;
index 7d4a3105700dd3fb0005772a9473f6ec14bdb9a1..77cf26337e10a175dee2f1e878bdfe91e14f4ecb 100644 (file)
@@ -1323,10 +1323,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
             case GL_INT:
             case GL_UNSIGNED_INT:
             case GL_FLOAT:
-               return GL_NO_ERROR;
             case GL_HALF_FLOAT:
-               return ctx->Extensions.ARB_half_float_pixel
-                  ? GL_NO_ERROR : GL_INVALID_ENUM;
+               return GL_NO_ERROR;
             default:
                return GL_INVALID_ENUM;
          }
@@ -1349,10 +1347,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
             case GL_INT:
             case GL_UNSIGNED_INT:
             case GL_FLOAT:
-               return GL_NO_ERROR;
             case GL_HALF_FLOAT:
-               return ctx->Extensions.ARB_half_float_pixel
-                  ? GL_NO_ERROR : GL_INVALID_ENUM;
+               return GL_NO_ERROR;
             default:
                return GL_INVALID_ENUM;
          }
@@ -1368,10 +1364,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
             case GL_INT:
             case GL_UNSIGNED_INT:
             case GL_FLOAT:
-               return GL_NO_ERROR;
             case GL_HALF_FLOAT:
-               return ctx->Extensions.ARB_half_float_pixel
-                  ? GL_NO_ERROR : GL_INVALID_ENUM;
+               return GL_NO_ERROR;
             default:
                return GL_INVALID_ENUM;
          }
@@ -1389,14 +1383,12 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
             case GL_UNSIGNED_BYTE_2_3_3_REV:
             case GL_UNSIGNED_SHORT_5_6_5:
             case GL_UNSIGNED_SHORT_5_6_5_REV:
+            case GL_HALF_FLOAT:
                return GL_NO_ERROR;
             case GL_UNSIGNED_INT_2_10_10_10_REV:
                /* OK by GL_EXT_texture_type_2_10_10_10_REV */
                return (ctx->API == API_OPENGLES2)
                   ? GL_NO_ERROR : GL_INVALID_ENUM;
-            case GL_HALF_FLOAT:
-               return ctx->Extensions.ARB_half_float_pixel
-                  ? GL_NO_ERROR : GL_INVALID_ENUM;
             case GL_UNSIGNED_INT_5_9_9_9_REV:
                return ctx->Extensions.EXT_texture_shared_exponent
                   ? GL_NO_ERROR : GL_INVALID_ENUM;
@@ -1419,10 +1411,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
             case GL_INT:
             case GL_UNSIGNED_INT:
             case GL_FLOAT:
-               return GL_NO_ERROR;
             case GL_HALF_FLOAT:
-               return ctx->Extensions.ARB_half_float_pixel
-                  ? GL_NO_ERROR : GL_INVALID_ENUM;
+               return GL_NO_ERROR;
             default:
                return GL_INVALID_ENUM;
          }
@@ -1446,10 +1436,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
             case GL_UNSIGNED_INT_8_8_8_8_REV:
             case GL_UNSIGNED_INT_10_10_10_2:
             case GL_UNSIGNED_INT_2_10_10_10_REV:
-               return GL_NO_ERROR;
             case GL_HALF_FLOAT:
-               return ctx->Extensions.ARB_half_float_pixel
-                  ? GL_NO_ERROR : GL_INVALID_ENUM;
+               return GL_NO_ERROR;
             default:
                return GL_INVALID_ENUM;
          }
index 205b2f2139ef38263abf5f0ecbc8507a66dee433..34b9e6d373b06bd4967a699be192ac054b0a21b5 100644 (file)
@@ -3451,7 +3451,6 @@ struct gl_extensions
    GLboolean ARB_explicit_attrib_location;
    GLboolean ARB_geometry_shader4;
    GLboolean ARB_gpu_shader5;
-   GLboolean ARB_half_float_pixel;
    GLboolean ARB_half_float_vertex;
    GLboolean ARB_instanced_arrays;
    GLboolean ARB_internalformat_query;
index 07ac1e1cfcdc1c06db6355d2cf96fdff45621aff..5938f5046e0ddbe11820b6846bd11b00a9ba3016 100644 (file)
@@ -397,11 +397,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
    if (ctx->Extensions.ARB_texture_rg) {
       switch (internalFormat) {
       case GL_R16F:
-        /* R16F depends on both ARB_half_float_pixel and ARB_texture_float.
-         */
-        if (!ctx->Extensions.ARB_half_float_pixel)
-           break;
-        /* FALLTHROUGH */
       case GL_R32F:
         if (!ctx->Extensions.ARB_texture_float)
            break;
@@ -422,11 +417,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
          return GL_RED;
 
       case GL_RG16F:
-        /* RG16F depends on both ARB_half_float_pixel and ARB_texture_float.
-         */
-        if (!ctx->Extensions.ARB_half_float_pixel)
-           break;
-        /* FALLTHROUGH */
       case GL_RG32F:
         if (!ctx->Extensions.ARB_texture_float)
            break;
@@ -4183,8 +4173,6 @@ _mesa_validate_texbuffer_format(const struct gl_context *ctx,
       return MESA_FORMAT_NONE;
 
    datatype = _mesa_get_format_datatype(format);
-   if (datatype == GL_FLOAT && !ctx->Extensions.ARB_texture_float)
-      return MESA_FORMAT_NONE;
 
    /* The GL_ARB_texture_buffer_object spec says:
     *
@@ -4195,9 +4183,8 @@ _mesa_validate_texbuffer_format(const struct gl_context *ctx,
     * As a result, GL_HALF_FLOAT internal format depends on both
     * GL_ARB_texture_float and GL_ARB_half_float_pixel.
     */
-   if (datatype == GL_HALF_FLOAT &&
-       !(ctx->Extensions.ARB_half_float_pixel
-         && ctx->Extensions.ARB_texture_float))
+   if ((datatype == GL_FLOAT || datatype == GL_HALF_FLOAT) &&
+       !ctx->Extensions.ARB_texture_float)
       return MESA_FORMAT_NONE;
 
    if (!ctx->Extensions.ARB_texture_rg) {
index 9af5f091e0448f411fb9c0e4998e086196485fcc..1c0bedf4bb2b3f18a047784bea73eca5768baea0 100644 (file)
@@ -232,7 +232,6 @@ compute_version(struct gl_context *ctx)
                               (ctx->API == API_OPENGL_CORE ||
                                ctx->Extensions.ARB_color_buffer_float) &&
                               ctx->Extensions.ARB_depth_buffer_float &&
-                              ctx->Extensions.ARB_half_float_pixel &&
                               ctx->Extensions.ARB_half_float_vertex &&
                               ctx->Extensions.ARB_map_buffer_range &&
                               ctx->Extensions.ARB_shader_texture_lod &&
index 1f391c9f0dde84d181442821e18b102e760a01b4..1b3b2205fef2452631d7ab23150e6254d79a904a 100644 (file)
@@ -528,7 +528,6 @@ void st_init_extensions(struct st_context *st)
    ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
    ctx->Extensions.ARB_fragment_program = GL_TRUE;
    ctx->Extensions.ARB_fragment_shader = GL_TRUE;
-   ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
    ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
    ctx->Extensions.ARB_internalformat_query = GL_TRUE;
    ctx->Extensions.ARB_map_buffer_range = GL_TRUE;