gallivm: fix srgb format fetch
authorRoland Scheidegger <sroland@vmware.com>
Sat, 1 Dec 2012 16:04:54 +0000 (17:04 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 3 Dec 2012 14:10:36 +0000 (14:10 +0000)
we need to rely on util code for fetching those, just like before
9f06061d50f90bf425a5337cea1b0adb94a46d25.
Fixes bugs 57699 and 57756.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_format_aos.c

index 0b54ba4c5f5c4af156e9b41ea733d7ae16a87068..c7fdb6e9d954151ae8c7d163d7bdf48a3ba6c282 100644 (file)
@@ -481,7 +481,8 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
    }
 
    /* If all channels are of same type and we are not using half-floats */
-   if (format_desc->is_array) {
+   if (format_desc->is_array &&
+       format_desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB) {
       assert(!format_desc->is_mixed);
       return lp_build_fetch_rgba_aos_array(gallivm, format_desc, type, base_ptr, offset);
    }