i965: Fix assert with multisampling and cubemaps
authorJordan Justen <jordan.l.justen@intel.com>
Wed, 24 Aug 2016 04:46:58 +0000 (21:46 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Fri, 26 Aug 2016 17:09:22 +0000 (10:09 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index e7aa6318109caaa34d9382878b25305c39bc5cb3..5fe6e4774365d281b587409a3c586a1f7d8e7d32 100644 (file)
@@ -384,6 +384,7 @@ intel_miptree_create_layout(struct brw_context *brw,
    mt->msaa_layout = INTEL_MSAA_LAYOUT_NONE;
    mt->refcount = 1;
 
+   int depth_multiply = 1;
    if (num_samples > 1) {
       /* Adjust width/height/depth for MSAA */
       mt->msaa_layout = compute_msaa_layout(brw, format,
@@ -470,7 +471,8 @@ intel_miptree_create_layout(struct brw_context *brw,
          }
       } else {
          /* Non-interleaved */
-         depth0 *= num_samples;
+         depth_multiply = num_samples;
+         depth0 *= depth_multiply;
       }
    }
 
@@ -500,7 +502,7 @@ intel_miptree_create_layout(struct brw_context *brw,
    }
 
    if (target == GL_TEXTURE_CUBE_MAP)
-      assert(depth0 == 6);
+      assert(depth0 == 6 * depth_multiply);
 
    mt->physical_width0 = width0;
    mt->physical_height0 = height0;