summaryrefslogtreecommitdiffstats
path: root/TextureLoader/src/TextureLoader.cpp
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-11-13 03:18:57 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-11-13 03:18:57 +0000
commit5e3941de79b573b8798f6a6bcd4eaf544c48cde2 (patch)
tree77f33c32420cec66a88f24555f7211c02136468a /TextureLoader/src/TextureLoader.cpp
parentMerge from dev branch (diff)
downloadDiligentTools-5e3941de79b573b8798f6a6bcd4eaf544c48cde2.tar.gz
DiligentTools-5e3941de79b573b8798f6a6bcd4eaf544c48cde2.zip
Updated to version 2.1
Diffstat (limited to 'TextureLoader/src/TextureLoader.cpp')
-rw-r--r--TextureLoader/src/TextureLoader.cpp25
1 files changed, 15 insertions, 10 deletions
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<Uint8>( NumComponents, IsSRGB,
- pSubResources[m-1].pData, pSubResources[m-1].Stride,
- Mips[m].data(), CoarseMipStride,
- CoarseMipWidth, CoarseMipHeight);
- else if( ChannelDepth == 16 )
- ComputeCoarseMip<Uint16>( NumComponents, IsSRGB,
- pSubResources[m-1].pData, pSubResources[m-1].Stride,
- Mips[m].data(), CoarseMipStride,
- CoarseMipWidth, CoarseMipHeight);
+ if (TexLoadInfo.GenerateMips)
+ {
+ if (ChannelDepth == 8)
+ ComputeCoarseMip<Uint8>(NumComponents, IsSRGB,
+ pSubResources[m - 1].pData, pSubResources[m - 1].Stride,
+ Mips[m].data(), CoarseMipStride,
+ CoarseMipWidth, CoarseMipHeight);
+ else if (ChannelDepth == 16)
+ ComputeCoarseMip<Uint16>(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<size_t>(pDDSData->GetSize()),
0, // maxSize
TexLoadInfo.Usage,
+ TexLoadInfo.Name,
TexLoadInfo.BindFlags,
TexLoadInfo.CPUAccessFlags,
0, // miscFlags