summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2018-06-10 11:34:37 -0400
committerRob Clark <robdclark@gmail.com>2018-06-19 13:02:28 -0400
commite0c6135625e1a2e2dc21a4e1472acb331af043cc (patch)
tree0224845fbb07189bc0ed834fba1f9c6de2644b16 /src
parent0bb0cac8dcd0d8907282242e548321f318a64536 (diff)
freedreno/a5xx: cubemap image fixes
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_image.c2
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_shader.c7
2 files changed, 7 insertions, 2 deletions
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;
+ }
}
}