st/mesa: don't choose DXT formats if we can't do DXT compression
authorBrian Paul <brianp@vmware.com>
Fri, 1 Feb 2013 01:52:57 +0000 (18:52 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 4 Feb 2013 14:58:21 +0000 (07:58 -0700)
commit4df42890c583172b0516fb90bf905e64889c5b75
treee1dd0793a8241a4ba2cd01d3af8f09b4c2903386
parent478056b81ae80ea3301511fb99b7ba5845202379
st/mesa: don't choose DXT formats if we can't do DXT compression

If we call gl[Copy]TexImage2D() with a generic compression format
(e.g. intFormat=GL_COMPRESSED_RGBA) we can't choose a DXT format if
we don't have the external DXT compression library.

We weren't actually enforcing this before since the
pipe_screen::is_format_supported(DXT) query has no dependency on
the DXT compression library.

Now if we're given a generic compressed format and we can't do DXT
compression we'll fall back to a non-compressed format.

v2: use util_format_is_s3tc() function and add more comments about
the allow_dxt parameter.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_format.h
src/mesa/state_tracker/st_texture.c