summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-05-31 01:16:20 +0200
committerMarek Olšák <[email protected]>2011-05-31 15:20:38 +0200
commitc4175c811eda0958db08875e4b44b31e4ef15b48 (patch)
tree091d7a8797e7c397525f8d8009bc485febcbd12a /src/gallium/drivers/r300
parentd2ede5e64809915a9432bd8aa77f56bd82935f3b (diff)
r300g: log when getting unsupported texture format
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_state.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 84d9da3ad9d..7127ea1ac16 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1465,6 +1465,8 @@ r300_create_sampler_view(struct pipe_context *pipe,
boolean dxtc_swizzle = r300_screen(pipe->screen)->caps.dxtc_swizzle;
if (view) {
+ unsigned hwformat;
+
view->base = *templ;
view->base.reference.count = 1;
view->base.context = pipe;
@@ -1476,11 +1478,19 @@ r300_create_sampler_view(struct pipe_context *pipe,
view->swizzle[2] = templ->swizzle_b;
view->swizzle[3] = templ->swizzle_a;
+ hwformat = r300_translate_texformat(templ->format,
+ view->swizzle,
+ is_r500,
+ dxtc_swizzle);
+
+ if (hwformat == ~0) {
+ fprintf(stderr, "r300: Ooops. Got unsupported format %s in %s.\n",
+ util_format_short_name(templ->format), __func__);
+ }
+ assert(hwformat != ~0);
+
view->format = tex->tx_format;
- view->format.format1 |= r300_translate_texformat(templ->format,
- view->swizzle,
- is_r500,
- dxtc_swizzle);
+ view->format.format1 |= hwformat;
if (is_r500) {
view->format.format2 |= r500_tx_format_msb_bit(templ->format);
}