gallium/radeon: don't allocate DCC for non-renderable texture formats
authorMarek Olšák <marek.olsak@amd.com>
Sun, 5 Jun 2016 23:29:14 +0000 (01:29 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 7 Jun 2016 22:22:45 +0000 (00:22 +0200)
R9G9B9E5 is the only uncompressed one hopefully.

This fixes incorrect rendering not discovered (due to a lack of tests)
until DCC mipmapping was enabled.

Cc: 11.1 11.2 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeon/r600_texture.c
src/gallium/drivers/radeon/radeon_winsys.h
src/gallium/winsys/amdgpu/drm/amdgpu_surface.c

index 920cc213b6ce11cb56e33d4663d2da397cd6a3ca..0f72a6d64aff4d02d4b4d64abf765b8faf0b1938 100644 (file)
@@ -281,6 +281,11 @@ static int r600_init_surface(struct r600_common_screen *rscreen,
        if (rscreen->chip_class >= SI) {
                surface->flags |= RADEON_SURF_HAS_TILE_MODE_INDEX;
        }
+
+       if (rscreen->chip_class >= VI &&
+           ptex->format == PIPE_FORMAT_R9G9B9E5_FLOAT)
+               surface->flags |= RADEON_SURF_DISABLE_DCC;
+
        return 0;
 }
 
index 806ea6378c3791d29c892219ad9415441a3873ae..a0c7abf9dc800948744b6c15189226558fd373fa 100644 (file)
@@ -342,6 +342,7 @@ enum radeon_feature_id {
 #define RADEON_SURF_HAS_SBUFFER_MIPTREE         (1 << 19)
 #define RADEON_SURF_HAS_TILE_MODE_INDEX         (1 << 20)
 #define RADEON_SURF_FMASK                       (1 << 21)
+#define RADEON_SURF_DISABLE_DCC                 (1 << 22)
 
 #define RADEON_SURF_GET(v, field)   (((v) >> RADEON_SURF_ ## field ## _SHIFT) & RADEON_SURF_ ## field ## _MASK)
 #define RADEON_SURF_SET(v, field)   (((v) & RADEON_SURF_ ## field ## _MASK) << RADEON_SURF_ ## field ## _SHIFT)
index d68c68844b01c91f1119dafc2bafd5f7ed6ca753..f609bf43f3557f62ab2d381e5fd346a5a4d1bd54 100644 (file)
@@ -343,6 +343,7 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
    AddrSurfInfoIn.flags.degrade4Space = 1;
    AddrSurfInfoIn.flags.dccCompatible = !(surf->flags & RADEON_SURF_Z_OR_SBUFFER) &&
                                         !(surf->flags & RADEON_SURF_SCANOUT) &&
+                                        !(surf->flags & RADEON_SURF_DISABLE_DCC) &&
                                         !compressed && AddrDccIn.numSamples <= 1;
 
    AddrSurfInfoIn.flags.noStencil = (surf->flags & RADEON_SURF_SBUFFER) == 0;