diff options
author | Ilia Mirkin <[email protected]> | 2015-11-21 11:49:03 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-11-23 11:17:15 -0500 |
commit | 93905a8df1d982d171ee690f9ec73f90f00fa49f (patch) | |
tree | 54f9d94b952774fc140a3001453ffbcb936fbc5d /src/gallium/drivers/freedreno/freedreno_resource.c | |
parent | 6b21d3c92e5878284c008edb68a0155edfcf89b4 (diff) |
freedreno/a4xx: add astc formats
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_resource.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index c8e2779d390..63ca9e30620 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -484,6 +484,7 @@ static uint32_t setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format format) { struct pipe_resource *prsc = &rsc->base.b; + enum util_format_layout layout = util_format_description(format)->layout; uint32_t level, size = 0; uint32_t width = prsc->width0; uint32_t height = prsc->height0; @@ -497,7 +498,11 @@ 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, 32); + if (layout == UTIL_FORMAT_LAYOUT_ASTC) + slice->pitch = width = + util_align_npot(width, 32 * util_format_get_blockwidth(format)); + else + slice->pitch = width = align(width, 32); slice->offset = size; blocks = util_format_get_nblocks(format, width, height); /* 1d array and 2d array textures must all have the same layer size |