summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/a6xx/fd6_resource.c')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_resource.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
index 4f5ab902662..fb24d230c44 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
@@ -73,7 +73,19 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format forma
pitchalign = tile_alignment[rsc->cpp].pitchalign;
aligned_height = align(aligned_height, heightalign);
} else {
- pitchalign = 64;
+ if (prsc->target == PIPE_TEXTURE_3D) {
+ unsigned a;
+ if (width >= 64) {
+ a = util_next_power_of_two(MAX2(width, height));
+ } else {
+ a = 16;
+ }
+
+ pitchalign = align(a, 64);
+ aligned_height = align(aligned_height, a);
+ } else {
+ pitchalign = 64;
+ }
/* The blits used for mem<->gmem work at a granularity of
* 32x32, which can cause faults due to over-fetch on the