freedreno/a5xx: cubemap image fixes
authorRob Clark <robdclark@gmail.com>
Sun, 10 Jun 2018 15:34:37 +0000 (11:34 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 19 Jun 2018 17:02:28 +0000 (13:02 -0400)
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a5xx/fd5_image.c
src/gallium/drivers/freedreno/ir3/ir3_shader.c

index a561643facc78a4e82c42480aeea77c446a340e5..be31c5d5fb03acb809815ef6c50a8f2b52558964 100644 (file)
@@ -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;
index 6ee732f9918ccb924ece9342adab3e8800fdb012..ff1ce4d053583404debbf80d6b07dd09857c2cd7 100644 (file)
@@ -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;
+                               }
                        }
                }