st/nine: NineBaseTexture9: fix setting of last_layer
authorAxel Davy <axel.davy@ens.fr>
Tue, 2 Dec 2014 21:18:30 +0000 (22:18 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 22 Jan 2015 22:16:18 +0000 (22:16 +0000)
Use same similar settings as u_sampler_view_default_template

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/nine/basetexture9.c

index 12da1e07616696585451b0bd7b89a705a3047a0c..af4778b35c16eef00d6fab7b052e344084d33401 100644 (file)
@@ -480,8 +480,8 @@ NineBaseTexture9_UpdateSamplerView( struct NineBaseTexture9 *This,
 
     templ.format = sRGB ? util_format_srgb(resource->format) : resource->format;
     templ.u.tex.first_layer = 0;
-    templ.u.tex.last_layer = (resource->target == PIPE_TEXTURE_CUBE) ?
-        5 : (This->base.info.depth0 - 1);
+    templ.u.tex.last_layer = resource->target == PIPE_TEXTURE_3D ?
+                             resource->depth0 - 1 : resource->array_size - 1;
     templ.u.tex.first_level = 0;
     templ.u.tex.last_level = resource->last_level;
     templ.swizzle_r = swizzle[0];