r600g: interpret integer texture types as ints.
authorDave Airlie <airlied@redhat.com>
Thu, 15 Sep 2011 11:41:00 +0000 (12:41 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 16 Sep 2011 08:26:57 +0000 (09:26 +0100)
For signed/unsigned with no normalisation or srgb, assume its an INT
type texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_texture.c

index 3811c49680783d96c7164ffe3fe3c6864e220df4..923547a28164560011167ae24a36451fd898467f 100644 (file)
@@ -1049,10 +1049,15 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
        switch (desc->channel[i].type) {
        case UTIL_FORMAT_TYPE_UNSIGNED:
        case UTIL_FORMAT_TYPE_SIGNED:
+#if 0
                if (!desc->channel[i].normalized &&
                    desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB) {
                        goto out_unknown;
                }
+#endif
+               if (desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB &&
+                   !desc->channel[i].normalized)
+                       word4 |= S_038010_NUM_FORMAT_ALL(V_038010_SQ_NUM_FORMAT_INT);
 
                switch (desc->channel[i].size) {
                case 4: