broadcom/vc5: Fix image_h setup for both loads and stores.
authorEric Anholt <eric@anholt.net>
Wed, 24 Jan 2018 01:13:53 +0000 (12:13 +1100)
committerEric Anholt <eric@anholt.net>
Thu, 1 Feb 2018 19:02:29 +0000 (11:02 -0800)
The image_h for the tiling algorithm needs to be the padded-to-a-uifblock
height of the level, not the unpadded height or the height of level 0.
Fixes some cases of KHR-GLES3.texture_repeat_mode.* and
depthstencil-render-miplevels.

src/gallium/drivers/vc5/vc5_resource.c

index f37ffe928fd706ccc544f5225dfc8d035199ee64..e2fe2826c2ee9e6e4946c32045195ec73af1b766 100644 (file)
@@ -133,8 +133,7 @@ vc5_resource_transfer_unmap(struct pipe_context *pctx,
                                               slice->stride,
                                               trans->map, ptrans->stride,
                                               slice->tiling, rsc->cpp,
-                                              u_minify(rsc->base.height0,
-                                                       ptrans->level),
+                                              slice->size / slice->stride,
                                               &ptrans->box);
                 }
                 free(trans->map);
@@ -265,7 +264,7 @@ vc5_resource_transfer_map(struct pipe_context *pctx,
                                              ptrans->box.z * rsc->cube_map_stride,
                                              slice->stride,
                                              slice->tiling, rsc->cpp,
-                                             rsc->base.height0,
+                                             slice->size / slice->stride,
                                              &ptrans->box);
                 }
                 return trans->map;