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.
This commit is contained in:
Eric Anholt 2018-12-04 14:18:45 -08:00
parent acecee4c2d
commit ee9b758053
1 changed files with 5 additions and 5 deletions

View File

@ -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 * at state create time, so any time this sampler view is used
* we need to add the texture to the job. * we need to add the texture to the job.
*/ */
tex.texture_base_pointer = cl_address(NULL, tex.texture_base_pointer =
rsc->bo->offset + cl_address(NULL,
rsc->slices[0].offset + rsc->bo->offset +
cso->u.tex.first_layer * v3d_layer_offset(prsc, 0,
rsc->cube_map_stride), cso->u.tex.first_layer));
tex.swizzle_r = translate_swizzle(so->swizzle[0]); tex.swizzle_r = translate_swizzle(so->swizzle[0]);
tex.swizzle_g = translate_swizzle(so->swizzle[1]); tex.swizzle_g = translate_swizzle(so->swizzle[1]);