From: Rob Clark Date: Sun, 10 Jun 2018 15:34:37 +0000 (-0400) Subject: freedreno/a5xx: cubemap image fixes X-Git-Tag: upstream/19.0.0~4542 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0c6135625e1a2e2dc21a4e1472acb331af043cc;p=platform%2Fupstream%2Fmesa.git freedreno/a5xx: cubemap image fixes Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_image.c b/src/gallium/drivers/freedreno/a5xx/fd5_image.c index a561643..be31c5d 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 6ee732f..ff1ce4d 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; + } } }