From: Yevhenii Kolesnikov Date: Fri, 26 Jun 2020 10:40:43 +0000 (+0300) Subject: nine: fix incorrect calculation of layer count for 3D textures X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=845a50ee2525c6cc4e6160eda1826c0670e0daaf;p=mesa.git nine: fix incorrect calculation of layer count for 3D textures Volume textures don't have a concept of "layers" v1: set last_layer to zero for 3D textures (Axel Davy) Cc: Signed-off-by: Yevhenii Kolesnikov Reviewed-by: Axel Davy Part-of: --- diff --git a/src/gallium/frontends/nine/basetexture9.c b/src/gallium/frontends/nine/basetexture9.c index 1f5608149eb..c9ef17c6c6e 100644 --- a/src/gallium/frontends/nine/basetexture9.c +++ b/src/gallium/frontends/nine/basetexture9.c @@ -563,7 +563,7 @@ NineBaseTexture9_UpdateSamplerView( struct NineBaseTexture9 *This, templ.format = resource->format; templ.u.tex.first_layer = 0; templ.u.tex.last_layer = resource->target == PIPE_TEXTURE_3D ? - resource->depth0 - 1 : resource->array_size - 1; + 0 : resource->array_size - 1; templ.u.tex.first_level = 0; templ.u.tex.last_level = resource->last_level; templ.swizzle_r = swizzle[0];