|
|
@@ -3036,12 +3036,26 @@ namespace bgfx { namespace d3d11
|
|
|
switch (texture.m_type)
|
|
|
{
|
|
|
case TextureD3D11::Texture2D:
|
|
|
- desc.ViewDimension = msaaSample
|
|
|
- ? D3D11_SRV_DIMENSION_TEXTURE2DMS
|
|
|
- : D3D11_SRV_DIMENSION_TEXTURE2D
|
|
|
- ;
|
|
|
- desc.Texture2D.MostDetailedMip = _mip;
|
|
|
- desc.Texture2D.MipLevels = 1;
|
|
|
+ if (1 < texture.m_depth)
|
|
|
+ {
|
|
|
+ desc.ViewDimension = msaaSample
|
|
|
+ ? D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY
|
|
|
+ : D3D11_SRV_DIMENSION_TEXTURE2DARRAY
|
|
|
+ ;
|
|
|
+ desc.Texture2DArray.MostDetailedMip = _mip;
|
|
|
+ desc.Texture2DArray.MipLevels = 1;
|
|
|
+ desc.Texture2DArray.FirstArraySlice = 0;
|
|
|
+ desc.Texture2DArray.ArraySize = texture.m_depth;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ desc.ViewDimension = msaaSample
|
|
|
+ ? D3D11_SRV_DIMENSION_TEXTURE2DMS
|
|
|
+ : D3D11_SRV_DIMENSION_TEXTURE2D
|
|
|
+ ;
|
|
|
+ desc.Texture2D.MostDetailedMip = _mip;
|
|
|
+ desc.Texture2D.MipLevels = 1;
|
|
|
+ }
|
|
|
break;
|
|
|
|
|
|
case TextureD3D11::TextureCube:
|