From: Christoph Bumiller Date: Thu, 13 Oct 2011 12:22:37 +0000 (+0200) Subject: d3d1x: MipLevels -1 in resource view desc means all X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dac5baf2e4702fabe627adc5b30e537560e8980d;p=mesa.git d3d1x: MipLevels -1 in resource view desc means all --- diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h index 74ad24cf4c3..899ccc7364b 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h @@ -1027,7 +1027,11 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen case D3D11_SRV_DIMENSION_TEXTURECUBE: // yes, this works for all of these types templat.u.tex.first_level = desc->Texture1D.MostDetailedMip; - templat.u.tex.last_level = templat.u.tex.first_level + desc->Texture1D.MipLevels - 1; + if(desc->Texture1D.MipLevels == (unsigned)-1) + templat.u.tex.last_level = templat.texture->last_level; + else + templat.u.tex.last_level = templat.u.tex.first_level + desc->Texture1D.MipLevels - 1; + assert(templat.u.tex.last_level >= templat.u.tex.first_level); break; case D3D11_SRV_DIMENSION_BUFFER: case D3D11_SRV_DIMENSION_TEXTURE2DMS: