radv/gfx9: fix level count in color register setup.
authorDave Airlie <airlied@redhat.com>
Mon, 21 Aug 2017 07:28:27 +0000 (08:28 +0100)
committerDave Airlie <airlied@redhat.com>
Thu, 24 Aug 2017 00:14:14 +0000 (01:14 +0100)
There was an off by one here.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_device.c

index 9bdad6ad6fdac478ff6be9ad277a3f5358cff79c..a32f76d648ed5980a81af392db359fb9f8c698ff 100644 (file)
@@ -3132,7 +3132,7 @@ radv_initialise_color_surface(struct radv_device *device,
                        S_028C74_RESOURCE_TYPE(iview->image->surface.u.gfx9.resource_type);
                cb->cb_color_attrib2 = S_028C68_MIP0_WIDTH(iview->image->info.width - 1) |
                        S_028C68_MIP0_HEIGHT(iview->image->info.height - 1) |
-                       S_028C68_MAX_MIP(iview->image->info.levels);
+                       S_028C68_MAX_MIP(iview->image->info.levels - 1);
 
                cb->gfx9_epitch = S_0287A0_EPITCH(iview->image->surface.u.gfx9.surf.epitch);