From: Axel Davy Date: Tue, 2 Dec 2014 21:18:30 +0000 (+0100) Subject: st/nine: NineBaseTexture9: fix setting of last_layer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18c7e702262425759cafddf7cc6d58543d97d7b3;p=mesa.git st/nine: NineBaseTexture9: fix setting of last_layer Use same similar settings as u_sampler_view_default_template Reviewed-by: Ilia Mirkin Reviewed-by: David Heidelberg Signed-off-by: Axel Davy Cc: "10.4" --- diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c index 12da1e07616..af4778b35c1 100644 --- a/src/gallium/state_trackers/nine/basetexture9.c +++ b/src/gallium/state_trackers/nine/basetexture9.c @@ -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];