summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKhaled Emara <[email protected]>2019-08-03 14:59:18 +0200
committerRob Clark <[email protected]>2019-08-12 22:30:54 +0000
commit0ae16fb565f5334c5d35a90836c675a32de2bf28 (patch)
tree80c84c4109b3ca8d67553644b7179108278933c1 /src/gallium
parentaeaba3e4a68502326e880e9318df13d02e0ed559 (diff)
freedreno: add tiling parameters for 2D/2DArray/3D
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_resource.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_resource.c b/src/gallium/drivers/freedreno/a3xx/fd3_resource.c
index e41043e2d3d..f6b52bd30a1 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_resource.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_resource.c
@@ -40,9 +40,17 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format forma
struct fd_resource_slice *slice = fd_resource_slice(rsc, level);
uint32_t blocks;
- slice->pitch = width = align(width, pitchalign);
+ if (rsc->tile_mode) {
+ width = util_next_power_of_two(width);
+ height = util_next_power_of_two(height);
+ uint32_t tpitch = width * rsc->cpp;
+ slice->pitch = (tpitch > 32) ? tpitch : 32;
+ } else {
+ slice->pitch = width = align(width, pitchalign);
+ }
+
slice->offset = size;
- blocks = util_format_get_nblocks(format, width, height);
+ blocks = util_format_get_nblocks(format, slice->pitch, height);
/* 1d array and 2d array textures must all have the same layer size
* for each miplevel on a3xx. 3d textures can have different layer
* sizes for high levels, but the hw auto-sizer is buggy (or at least
@@ -95,6 +103,15 @@ ok_format(enum pipe_format pfmt)
if (fmt == ~0)
return false;
+ switch (pfmt) {
+ case PIPE_FORMAT_R8_UINT:
+ case PIPE_FORMAT_R8_SINT:
+ case PIPE_FORMAT_Z32_FLOAT:
+ return false;
+ default:
+ break;
+ }
+
return true;
}