radeonsi: treat intensity render targets exactly like red
authorMarek Olšák <marek.olsak@amd.com>
Thu, 28 Jan 2016 00:35:19 +0000 (01:35 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 2 Feb 2016 20:03:18 +0000 (21:03 +0100)
The motivation is to simplify the Stoney RB+ code.
Intensity is already treated as red except here.

No piglit regressions.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 9e0ccfc5dde285e21329e65b5fa4f0037425b7c1..40ae13f02ef6e8d73c0842b41ddd9f2af3b58ac7 100644 (file)
@@ -2097,8 +2097,10 @@ static void si_initialize_color_surface(struct si_context *sctx,
 
        color_pitch = S_028C64_TILE_MAX(pitch);
 
+       /* Intensity is implemented as Red, so treat it that way. */
        color_attrib = S_028C74_TILE_MODE_INDEX(tile_mode_index) |
-               S_028C74_FORCE_DST_ALPHA_1(desc->swizzle[3] == UTIL_FORMAT_SWIZZLE_1);
+               S_028C74_FORCE_DST_ALPHA_1(desc->swizzle[3] == UTIL_FORMAT_SWIZZLE_1 ||
+                                          util_format_is_intensity(surf->base.format));
 
        if (rtex->resource.b.b.nr_samples > 1) {
                unsigned log_samples = util_logbase2(rtex->resource.b.b.nr_samples);