summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a3xx
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2014-09-13 08:25:51 -0400
committerRob Clark <[email protected]>2014-09-13 15:31:58 -0400
commitca29c4c3b0e779909467c0739fc176c64a829142 (patch)
treee55cd3fe0ec2e91081b288f528fd250e2f5cf1fc /src/gallium/drivers/freedreno/a3xx
parenteea1cdf687d7089b2dc24e1dd7da59b3acf3dd3b (diff)
freedreno/a3xx: 3d/array textures
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_texture.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_texture.c b/src/gallium/drivers/freedreno/a3xx/fd3_texture.c
index b0e5efb10a4..8a5140f36f9 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_texture.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_texture.c
@@ -175,7 +175,24 @@ fd3_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
/* when emitted, A3XX_TEX_CONST_2_INDX() must be OR'd in: */
so->texconst2 =
A3XX_TEX_CONST_2_PITCH(rsc->slices[lvl].pitch * rsc->cpp);
- so->texconst3 = 0x00000000; /* ??? */
+ switch (prsc->target) {
+ case PIPE_TEXTURE_1D_ARRAY:
+ case PIPE_TEXTURE_2D_ARRAY:
+ so->texconst3 =
+ A3XX_TEX_CONST_3_DEPTH(u_minify(prsc->array_size, lvl)) |
+ A3XX_TEX_CONST_3_LAYERSZ1(rsc->slices[0].size0) |
+ A3XX_TEX_CONST_3_LAYERSZ2(rsc->slices[0].size0);
+ break;
+ case PIPE_TEXTURE_3D:
+ so->texconst3 =
+ A3XX_TEX_CONST_3_DEPTH(u_minify(prsc->depth0, lvl)) |
+ A3XX_TEX_CONST_3_LAYERSZ1(rsc->slices[0].size0) |
+ A3XX_TEX_CONST_3_LAYERSZ2(rsc->slices[0].size0);
+ break;
+ default:
+ so->texconst3 = 0x00000000;
+ break;
+ }
return &so->base;
}