[Mesa-dev] [Bug 44039] Mesa 7.12-devel implementation error: unexpected format 0x822e in _mesa_choose_tex_format()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jan 16 08:10:51 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=44039

--- Comment #4 from Brian Paul <brianp at vmware.com> 2012-01-16 08:10:51 PST ---
OK, I think I see the problem.  I reproduced something similar with a piglit
test.

I have a gen 4 i965 laptop.  If I compile with TEXTURE_FLOAT_ENABLED, glxinfo
says GL_ARB_texture_float (and GL_ARB_texture_rg) is supported.  But
internally, the ctx->TextureFormatSupported[MESA_FORMAT_RGBA_FLOAT32] entry is
false (so is the R_FLOAT32 entry).

In texformat.c the switch case for GL_R32F (0x822e) reads:

      case GL_R32F:
     RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT32);
     RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
     break;

Neither the R_FLOAT32 nor RGBA_FLOAT32 formats are supported so we end up
generating the error message in the bug title.

The solution is to add a few more tests:

      case GL_R32F:
     RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT32);
     RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
     RETURN_IF_SUPPORTED(MESA_FORMAT_R_FLOAT16);
     RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
     break;

and use a 16-bit format if the 32-bit format is not supported.  We already do
the same thing earlier in the function for the GL_RGBA_32F case, etc.

I'll write a patch for this.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list