From 5e3941de79b573b8798f6a6bcd4eaf544c48cde2 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 12 Nov 2017 19:18:57 -0800 Subject: Updated to version 2.1 --- TextureLoader/src/TextureLoader.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'TextureLoader/src/TextureLoader.cpp') diff --git a/TextureLoader/src/TextureLoader.cpp b/TextureLoader/src/TextureLoader.cpp index 14f6f24..cf7a32d 100644 --- a/TextureLoader/src/TextureLoader.cpp +++ b/TextureLoader/src/TextureLoader.cpp @@ -119,6 +119,7 @@ namespace Diligent { const auto& ImgDesc = pSrcImage->GetDesc(); TextureDesc TexDesc; + TexDesc.Name = TexLoadInfo.Name; TexDesc.Type = RESOURCE_DIM_TEX_2D; TexDesc.Width = ImgDesc.Width; TexDesc.Height = ImgDesc.Height; @@ -204,16 +205,19 @@ namespace Diligent CoarseMipStride = (CoarseMipStride + 3) & (-4); Mips[m].resize(CoarseMipStride * CoarseMipHeight); - if( ChannelDepth == 8 ) - ComputeCoarseMip( NumComponents, IsSRGB, - pSubResources[m-1].pData, pSubResources[m-1].Stride, - Mips[m].data(), CoarseMipStride, - CoarseMipWidth, CoarseMipHeight); - else if( ChannelDepth == 16 ) - ComputeCoarseMip( NumComponents, IsSRGB, - pSubResources[m-1].pData, pSubResources[m-1].Stride, - Mips[m].data(), CoarseMipStride, - CoarseMipWidth, CoarseMipHeight); + if (TexLoadInfo.GenerateMips) + { + if (ChannelDepth == 8) + ComputeCoarseMip(NumComponents, IsSRGB, + pSubResources[m - 1].pData, pSubResources[m - 1].Stride, + Mips[m].data(), CoarseMipStride, + CoarseMipWidth, CoarseMipHeight); + else if (ChannelDepth == 16) + ComputeCoarseMip(NumComponents, IsSRGB, + pSubResources[m - 1].pData, pSubResources[m - 1].Stride, + Mips[m].data(), CoarseMipStride, + CoarseMipWidth, CoarseMipHeight); + } pSubResources[m].pData = Mips[m].data(); pSubResources[m].Stride = CoarseMipStride; @@ -239,6 +243,7 @@ namespace Diligent static_cast(pDDSData->GetSize()), 0, // maxSize TexLoadInfo.Usage, + TexLoadInfo.Name, TexLoadInfo.BindFlags, TexLoadInfo.CPUAccessFlags, 0, // miscFlags -- cgit v1.2.3