summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-06-07 15:44:28 -0400
committerRob Clark <[email protected]>2018-06-11 09:06:03 -0400
commit55d1a77c29e2bf122e56d462aac255739b6f85e2 (patch)
tree694ad18aab99d2b75f18658b4188abf1c22433e3 /src
parent9bb90a3255c7494796d57eef3a73bc0b77a005d5 (diff)
freedreno/ir3: use pipe_image_view's cpp
At least for PIPE_BUFFER, we could get the resource used as (for example) R32F imageBuffer. So using cpp=1 from the rsc is wrong. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_shader.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.c b/src/gallium/drivers/freedreno/ir3/ir3_shader.c
index 8ed7f5673c8..6ee732f9918 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_shader.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.c
@@ -660,9 +660,14 @@ emit_image_dims(struct fd_context *ctx, const struct ir3_shader_variant *v,
img = &si->si[index];
rsc = fd_resource(img->resource);
- dims[off + 0] = rsc->cpp;
+ dims[off + 0] = util_format_get_blocksize(img->format);
if (img->resource->target != PIPE_BUFFER) {
unsigned lvl = img->u.tex.level;
+ /* note for 2d/cube/etc images, even if re-interpreted
+ * as a different color format, the pixel size should
+ * be the same, so use original dimensions for y and z
+ * stride:
+ */
dims[off + 1] = rsc->slices[lvl].pitch * rsc->cpp;
dims[off + 2] = rsc->slices[lvl].size0;
}