summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_format.c
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2014-03-29 12:02:54 +1300
committerChris Forbes <chrisf@ijw.co.nz>2014-04-01 11:56:18 +1300
commite3cdbdb14b54b8417088520dc3187477a4dd04ad (patch)
tree3a97e50b5023d2ca4ff21cc4084fd239331023c7 /src/mesa/state_tracker/st_format.c
parent3196c53c5d9bc25dae8c220c3dc38eb510612f76 (diff)
downloadexternal_mesa3d-e3cdbdb14b54b8417088520dc3187477a4dd04ad.zip
external_mesa3d-e3cdbdb14b54b8417088520dc3187477a4dd04ad.tar.gz
external_mesa3d-e3cdbdb14b54b8417088520dc3187477a4dd04ad.tar.bz2
st: fix st_choose_matching_format to ignore intensity
_mesa_format_matches_format_and_type() returns true for GL_RED/GL_RED_INTEGER (with an appropriate type) into an intensity mesa_format. We want the `red`-based format instead, regardless of the order we find them in our walk of the mesa formats list. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/mesa/state_tracker/st_format.c')
-rw-r--r--src/mesa/state_tracker/st_format.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index cd6b466..38d4ccf 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1750,6 +1750,12 @@ st_choose_matching_format(struct pipe_screen *screen, unsigned bind,
if (_mesa_get_format_color_encoding(mesa_format) == GL_SRGB) {
continue;
}
+ if (_mesa_get_format_bits(mesa_format, GL_TEXTURE_INTENSITY_SIZE) > 0) {
+ /* If `format` is GL_RED/GL_RED_INTEGER, then we might match some
+ * intensity formats, which we don't want.
+ */
+ continue;
+ }
if (_mesa_format_matches_format_and_type(mesa_format, format, type,
swapBytes)) {