summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_sampler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util/u_sampler.c')
-rw-r--r--src/gallium/auxiliary/util/u_sampler.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_sampler.c b/src/gallium/auxiliary/util/u_sampler.c
index e77f562ea22..bb26099b7e1 100644
--- a/src/gallium/auxiliary/util/u_sampler.c
+++ b/src/gallium/auxiliary/util/u_sampler.c
@@ -40,8 +40,11 @@ default_template(struct pipe_sampler_view *view,
*/
view->format = format;
- view->first_level = 0;
- view->last_level = texture->last_level;
+ view->u.tex.first_level = 0;
+ view->u.tex.last_level = texture->last_level;
+ view->u.tex.first_layer = 0;
+ view->u.tex.last_layer = texture->target == PIPE_TEXTURE_3D ?
+ texture->depth0 - 1 : texture->array_size - 1;
view->swizzle_r = PIPE_SWIZZLE_RED;
view->swizzle_g = PIPE_SWIZZLE_GREEN;
view->swizzle_b = PIPE_SWIZZLE_BLUE;