summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno')
-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;
+ }
}
}