aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-12-04 14:18:45 -0800
committerEric Anholt <[email protected]>2018-12-07 16:48:23 -0800
commitee9b758053760ebaee7b5950be358de461a1cd8d (patch)
tree3d2b8d70e57847dc44fb37061044bc70a077cd5b /src
parentacecee4c2db48fb36bce1170d8747c7345ba3541 (diff)
v3d: Fix handling of texture first_layer offsets for 3D textures.
I think this bug predated adding v3d_layer_offset(). Noticed during an unrelated refactor.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/v3d/v3dx_state.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_state.c b/src/gallium/drivers/v3d/v3dx_state.c
index 0d1a74091d5..cf64fc42452 100644
--- a/src/gallium/drivers/v3d/v3dx_state.c
+++ b/src/gallium/drivers/v3d/v3dx_state.c
@@ -753,11 +753,11 @@ v3d_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
* at state create time, so any time this sampler view is used
* we need to add the texture to the job.
*/
- tex.texture_base_pointer = cl_address(NULL,
- rsc->bo->offset +
- rsc->slices[0].offset +
- cso->u.tex.first_layer *
- rsc->cube_map_stride),
+ tex.texture_base_pointer =
+ cl_address(NULL,
+ rsc->bo->offset +
+ v3d_layer_offset(prsc, 0,
+ cso->u.tex.first_layer));
tex.swizzle_r = translate_swizzle(so->swizzle[0]);
tex.swizzle_g = translate_swizzle(so->swizzle[1]);