When saving typeless textures to DDS, use typeCast to inform type used

This commit is contained in:
baldurk
2019-11-21 16:36:52 +00:00
parent 64c9b93e27
commit 592d2edff1
+6 -1
View File
@@ -1282,10 +1282,15 @@ bool ReplayController::SaveTexture(const TextureSave &saveData, const char *path
{
dds_data ddsData;
ResourceFormat saveFmt = td.format;
// use typeCast to inform typeless saving, otherwise it will get lost
if(saveFmt.compType == CompType::Typeless)
saveFmt.compType = sd.typeHint;
ddsData.width = td.width;
ddsData.height = td.height;
ddsData.depth = td.depth;
ddsData.format = td.format;
ddsData.format = saveFmt;
ddsData.mips = numMips;
ddsData.slices = numSlices / td.depth;
ddsData.subdata = &subdata[0];