r300g: integer and fixed-point 16.16 textures are not supported
authorMarek Olšák <maraeo@gmail.com>
Sun, 11 Dec 2011 12:25:56 +0000 (13:25 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 12 Dec 2011 07:04:51 +0000 (08:04 +0100)
src/gallium/drivers/r300/r300_texture.c

index fa09410c6a530c1c1c552d74ccb2c974fb95c135..2738f582f69d1b1ac1d5937124e930b2641c05d2 100644 (file)
@@ -236,6 +236,17 @@ uint32_t r300_translate_texformat(enum pipe_format format,
         return R300_TX_FORMAT_CxV8U8 | result;
     }
 
+    /* Integer and fixed-point 16.16 textures are not supported. */
+    for (i = 0; i < 4; i++) {
+        if (desc->channel[i].type == UTIL_FORMAT_TYPE_FIXED ||
+            ((desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED ||
+              desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED) &&
+             (!desc->channel[i].normalized ||
+              desc->channel[i].pure_integer))) {
+            return ~0; /* Unsupported/unknown. */
+        }
+    }
+
     /* Add sign. */
     for (i = 0; i < desc->nr_channels; i++) {
         if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) {