From e0c6135625e1a2e2dc21a4e1472acb331af043cc Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 10 Jun 2018 11:34:37 -0400 Subject: freedreno/a5xx: cubemap image fixes Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/a5xx/fd5_image.c | 2 +- src/gallium/drivers/freedreno/ir3/ir3_shader.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/freedreno') diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_image.c b/src/gallium/drivers/freedreno/a5xx/fd5_image.c index a561643facc..be31c5d5fb0 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_image.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_image.c @@ -107,7 +107,7 @@ static void translate_image(struct fd5_image *img, struct pipe_image_view *pimg) case PIPE_TEXTURE_CUBE: case PIPE_TEXTURE_CUBE_ARRAY: img->array_pitch = rsc->layer_size; - img->depth = layers / 6; + img->depth = layers; break; case PIPE_TEXTURE_3D: img->array_pitch = rsc->slices[lvl].size0; diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.c b/src/gallium/drivers/freedreno/ir3/ir3_shader.c index 6ee732f9918..ff1ce4d0535 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.c @@ -669,7 +669,12 @@ emit_image_dims(struct fd_context *ctx, const struct ir3_shader_variant *v, * stride: */ dims[off + 1] = rsc->slices[lvl].pitch * rsc->cpp; - dims[off + 2] = rsc->slices[lvl].size0; + /* see corresponding logic in fd_resource_offset(): */ + if (rsc->layer_first) { + dims[off + 2] = rsc->layer_size; + } else { + dims[off + 2] = rsc->slices[lvl].size0; + } } } -- cgit v1.2.3