[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 12:00:58 PST 2012


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

--- Comment #5 from Ian Romanick <idr at freedesktop.org> 2012-01-16 12:00:58 PST ---
(In reply to comment #4)
> 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;

We didn't already do this because the OpenGL 3.0 spec requires that GL_R32F be
32-bit float.  Ken dug into this a bit, and the problem is that GEN4 can't do
filtering on 32-bit float formats.  Our current thinking is to just disable
GL_ARB_texture_float on GEN4 and GEN4.5.

We could maybe add this work-around, but we'd have to modify compute_version to
only advertise 3.0 if the required FLOAT32 formats are supported.  Is that
doable?

> 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