mesa: GL_ARB_half_float_pixel is not optional

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>
This commit is contained in:
Ian Romanick 2014-01-13 15:23:48 -08:00 committed by Eric Anholt
parent 6d6a290181
commit 1edca151a0
10 changed files with 10 additions and 42 deletions

View 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 ()

View 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;

View 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;

View 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;

View 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;

View 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;
}

View 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;

View 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) {

View 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 &&

View 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;