anv/cmd_buffer: Set depth/stencil extent based on the image
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 14 Jun 2016 00:09:37 +0000 (17:09 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 20 Jun 2016 19:03:05 +0000 (12:03 -0700)
It used to be based on the framebuffer which isn't quite right.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/genX_cmd_buffer.c

index d9acf58517c4343fa448586d0c9eb98eb11c28d8..c62bed4096939d7a43acbf0e41bdb9f6eee1d7fe 100644 (file)
@@ -1024,11 +1024,11 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer)
          db.DepthBufferObjectControlState = GENX(MOCS),
 
          db.SurfacePitch         = image->depth_surface.isl.row_pitch - 1;
-         db.Height               = fb->height - 1;
-         db.Width                = fb->width - 1;
-         db.LOD                  = 0;
-         db.Depth                = 1 - 1;
-         db.MinimumArrayElement  = 0;
+         db.Height               = image->extent.height - 1;
+         db.Width                = image->extent.width - 1;
+         db.LOD                  = iview->base_mip;
+         db.Depth                = image->array_size - 1; /* FIXME: 3-D */
+         db.MinimumArrayElement  = iview->base_layer;
 
 #if GEN_GEN >= 8
          db.SurfaceQPitch =