Mesa (master): r300g: advertise S3TC only when it's available in Gallium
Marek Olšák
mareko at kemper.freedesktop.org
Tue May 4 18:10:21 UTC 2010
Module: Mesa
Branch: master
Commit: 88512e837e45b72c33a7d28ccf02f00580a4cf10
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=88512e837e45b72c33a7d28ccf02f00580a4cf10
Author: Marek Olšák <maraeo at gmail.com>
Date: Tue May 4 20:09:53 2010 +0200
r300g: advertise S3TC only when it's available in Gallium
---
src/gallium/drivers/r300/r300_texture.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index d6f629c..a6f65fc 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -24,6 +24,7 @@
#include "pipe/p_screen.h"
#include "util/u_format.h"
+#include "util/u_format_s3tc.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@@ -170,6 +171,10 @@ uint32_t r300_translate_texformat(enum pipe_format format,
/* S3TC formats. */
if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) {
+ if (!util_format_s3tc_enabled) {
+ return ~0; /* Unsupported. */
+ }
+
switch (format) {
case PIPE_FORMAT_DXT1_RGB:
case PIPE_FORMAT_DXT1_RGBA:
More information about the mesa-commit
mailing list