unsigned depth = res->depth0;
unsigned bytes_per_pixel = util_format_get_blocksize(pres->internal_format);
+ /* MSAA is implemented as a 3D texture with z corresponding to the
+ * sample #, horrifyingly enough */
+
+ bool msaa = res->nr_samples > 1;
+
+ if (msaa) {
+ assert(depth == 1);
+ depth = res->nr_samples;
+ }
+
assert(depth > 0);
/* Tiled operates blockwise; linear is packed. Also, anything
width = u_minify(width, 1);
height = u_minify(height, 1);
- depth = u_minify(depth, 1);
+
+ /* Don't mipmap the sample count */
+ if (!msaa)
+ depth = u_minify(depth, 1);
}
assert(res->array_size);