Revert "mesa: allow half float textures based on ARB_half_float_pixel"
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 12 Jan 2021 21:59:14 +0000 (13:59 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 20 Jan 2021 01:24:43 +0000 (01:24 +0000)
This reverts commit aca67a555c011f59c37b05544eecbeea9aa42f3e, which
regressed the following Piglit test on i915 (and presumably r200):

   piglit/spec/!opengl 1.1/sized-texture-format-channels

Specifically, it begins testing glTexImage2D with format GL_RGBA,
type GL_FLOAT, and internalFormat GL_RGB16F, which leads to the
following error:

   Mesa 21.0.0-devel implementation error: unexpected format GL_RGB16F in _mesa_choose_tex_format()
   Please report at https://gitlab.freedesktop.org/mesa/mesa/-/issues
   sized-texture-format-channels: ../../src/mesa/main/teximage.c:2836: _mesa_choose_texture_format: Assertion `f != MESA_FORMAT_NONE' failed.

i915 and r200 unconditionally support ARB_half_float_pixel, but neither
support RGB16F as an internal format.  According to Ian's rationale
in the commit message for 1edca151a00134778b959366d5e7c0a3b63cc8f7
(which enabled that extension for all drivers):

    "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."

So, commit aca67a55c011 enabled half-float internal formats on hardware
that cannot support them.  We should revert the change.

v2: Don't reintroduce the _mesa_is_gles3() condition, as that shouldn't
    be necessary (feedback from Erik Faye-Lund).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8458>

src/mesa/main/context.h

index b42fa40..9ffd75f 100644 (file)
@@ -356,7 +356,6 @@ static inline bool
 _mesa_has_half_float_textures(const struct gl_context *ctx)
 {
    return _mesa_has_ARB_texture_float(ctx) ||
-          _mesa_has_ARB_half_float_pixel(ctx) ||
           _mesa_has_OES_texture_half_float(ctx);
 }