freedreno: Make the slice pitch be bytes, not pixels.
[mesa.git] / src / gallium / drivers / freedreno / a3xx / fd3_resource.c
index 6089ca01e40ede9afd2b637e588708feda2c44c6..0a58c16abc6d04d676253d3ca53cf71b37e89025 100644 (file)
@@ -63,6 +63,8 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format forma
                        slice->pitch = width = align(width, pitchalign);
                        blocks = util_format_get_nblocks(format, slice->pitch, height);
                }
+               slice->pitch = util_format_get_nblocksx(format, slice->pitch) *
+                       rsc->layout.cpp;
 
                slice->offset = size;
                /* 1d array and 2d array textures must all have the same layer size