aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h6
1 files changed, 5 insertions, 1 deletions
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: