From dac5baf2e4702fabe627adc5b30e537560e8980d Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Thu, 13 Oct 2011 14:22:37 +0200 Subject: [PATCH] d3d1x: MipLevels -1 in resource view desc means all --- src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h index 74ad24c..899ccc7 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: -- 2.7.4