freedreno: Make the slice pitch be bytes, not pixels.
[mesa.git] / src / freedreno / fdl / fd6_layout.c
index 0f8f14dfc2dd48cfc2b751878f4955bc773bdd4a..033b5c33f996f70322523e985e0f65850c50a5c1 100644 (file)
@@ -155,12 +155,15 @@ fdl6_layout(struct fdl_layout *layout,
                if (level == mip_levels - 1)
                        height = align(height, 32);
 
-               slice->pitch = util_align_npot(u_minify(pitch0, level),
+               uint32_t pitch_pixels = util_align_npot(u_minify(pitch0, level),
                                fdl6_pitchalign(layout, ta, level));
 
                slice->offset = layout->size;
                uint32_t blocks = util_format_get_nblocks(format,
-                               slice->pitch, height);
+                               pitch_pixels, height);
+
+               slice->pitch = util_format_get_nblocksx(format, pitch_pixels) *
+                       layout->cpp;
 
                /* 1d array and 2d array textures must all have the same layer size
                 * for each miplevel on a6xx. 3d textures can have different layer