summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2019-01-02 13:24:31 -0500
committerRob Clark <robdclark@gmail.com>2019-01-03 08:11:40 -0500
commite869481ef30d0c3576d402816fa341ea1e21456a (patch)
treebf89c8f47233c491975d02ba00b5735e172cae18 /src/gallium/drivers
parent67a7f6f24433beb5795bea5325700f50d845ed64 (diff)
freedreno: fix staging resource size for arrays
A 2d-array texture (for example), should get the # of array elements from box->depth, rather than depth0 which is minified. Fixes dEQP-GLES3.functional.shaders.texture_functions.texture.sampler2darray_bias_float_fragment with tiled textures. Reported-by: Kristian H. Kristensen <hoegsberg@chromium.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_resource.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 838881cf150..f19f38add85 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -294,8 +294,16 @@ fd_alloc_staging(struct fd_context *ctx, struct fd_resource *rsc,
tmpl.width0 = box->width;
tmpl.height0 = box->height;
- tmpl.depth0 = box->depth;
- tmpl.array_size = 1;
+ /* for array textures, box->depth is the array_size, otherwise
+ * for 3d textures, it is the depth:
+ */
+ if (tmpl.array_size > 1) {
+ tmpl.array_size = box->depth;
+ tmpl.depth0 = 1;
+ } else {
+ tmpl.array_size = 1;
+ tmpl.depth0 = box->depth;
+ }
tmpl.last_level = 0;
tmpl.bind |= PIPE_BIND_LINEAR;