[Mesa-dev] [PATCH 0/2] Fix EXT_texture_snorm issues with i965
idr at freedesktop.org
Sat Apr 2 19:18:39 PDT 2011
Part of the patch series that added GL_EXT_texture_snorm support to
Mesa seems to have broken some drivers. In particular, commit
0be36997 causes drivers that previously advertised
GL_MESA_texture_signed_rgba magically start advertising
GL_EXT_texture_snorm. However, these drivers don't magically know
about the formats added with GL_EXT_texture_snorm, so they run into
problems when the encounter them. This causes the i965 driver to hit
an assertion failure when glean's pixelFormats test gives it an
internal format of GL_RED_SNORM:
glean: main/teximage.c:2384: _mesa_choose_texture_format: Assertion `f !=
It seems that i965 is the only driver in this situation. Rather than
breaking the extension back into two enables, I chose to just fix this
missing bits. There are two parts to this:
1. Enable the snorm formats in the i965 driver that the hardware can
do. This is done by the first patch.
2. Provide fall-back formats for the formats that i965 hardware cannot
natively do. This is done by the second patch.
With these two patchs, glean's pixelFormats test passes on my Ironlake
system once again.
It is also worth noting that there are a *lot* of other places where
fall-back formats should be used in _mesa_choose_tex_format. Right
now if a driver does not support MESA_FORMAT_ARGB4444 and an
application requests an internal format of GL_RGBA4, the driver will
probably hit this same assertion.
There are a few refactors possible, but they will require quite a bit
more effort than I have time for right now. As mentioned in the
commit message for the second patch, these kinds of missing formats
can be emulated through the use of GL_EXT_texture_swizzle.
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 +++
src/mesa/drivers/dri/intel/intel_context.c | 5 ++++
src/mesa/main/texformat.c | 26 +++++++++++++++++++--
3 files changed, 32 insertions(+), 3 deletions(-)
More information about the mesa-dev