From 3a39eb95e405d3b0460d6c03e9982641fc07d9a9 Mon Sep 17 00:00:00 2001 From: NavNTCMP Date: Tue, 12 Mar 2024 10:10:08 -0400 Subject: [PATCH] Revert "Add BC7_SRGB format support" --- .../gltf_dx12_ex/dx12util/cmp_texturedx12.cpp | 3 --- .../c3dmodel_viewers/vulkan/util/cmp_texturevk.cpp | 3 --- .../_plugins/cgpudecode/directx/gpu_directx.cpp | 3 --- applications/_plugins/cgpudecode/opengl/gpu_opengl.cpp | 3 --- applications/_plugins/cgpudecode/vulkan/gpu_vulkan.cpp | 3 --- applications/_plugins/cimage/dds/dds_dx10.cpp | 10 +--------- applications/_plugins/cimage/ktx/ktx1.cpp | 8 -------- applications/_plugins/cimage/ktx/ktx1.h | 1 - applications/_plugins/cimage/ktx2/ktx2.cpp | 7 ------- applications/_plugins/cimage/ktx2/ktx2.h | 1 - .../_plugins/cmp_gpu/directx/compute_directx.cpp | 5 ----- applications/_plugins/common/atiformats.cpp | 10 +--------- applications/_plugins/common/cmdline.cpp | 8 +++----- applications/_plugins/common/codec_common.cpp | 5 +---- applications/_plugins/common/codec_common.h | 3 +-- applications/_plugins/common/texture.h | 2 -- applications/_plugins/common/textureio.cpp | 1 - cmp_compressonatorlib/bc7/codec_bc7.cpp | 4 ++-- cmp_compressonatorlib/bc7/codec_bc7.h | 2 +- cmp_compressonatorlib/common/codec.cpp | 3 +-- cmp_compressonatorlib/compress.cpp | 4 ---- cmp_compressonatorlib/compressonator.cpp | 5 +---- cmp_compressonatorlib/compressonator.h | 7 +++---- examples/common/dds_helpers.cpp | 5 +---- 24 files changed, 16 insertions(+), 90 deletions(-) diff --git a/applications/_plugins/c3dmodel_viewers/gltf_dx12_ex/dx12util/cmp_texturedx12.cpp b/applications/_plugins/c3dmodel_viewers/gltf_dx12_ex/dx12util/cmp_texturedx12.cpp index f4423e6dc..4005beef0 100644 --- a/applications/_plugins/c3dmodel_viewers/gltf_dx12_ex/dx12util/cmp_texturedx12.cpp +++ b/applications/_plugins/c3dmodel_viewers/gltf_dx12_ex/dx12util/cmp_texturedx12.cpp @@ -524,9 +524,6 @@ DXGI_FORMAT CMP2DXGIFormat(CMP_FORMAT cmp_format) { case CMP_FORMAT_BC7: dxgi_format = DXGI_FORMAT_BC7_UNORM; break; - case CMP_FORMAT_BC7_SRGB: - dxgi_format = DXGI_FORMAT_BC7_UNORM_SRGB; - break; //uncompressed format case CMP_FORMAT_ARGB_8888: case CMP_FORMAT_RGBA_8888: diff --git a/applications/_plugins/c3dmodel_viewers/vulkan/util/cmp_texturevk.cpp b/applications/_plugins/c3dmodel_viewers/vulkan/util/cmp_texturevk.cpp index c0e419288..e1190aa69 100644 --- a/applications/_plugins/c3dmodel_viewers/vulkan/util/cmp_texturevk.cpp +++ b/applications/_plugins/c3dmodel_viewers/vulkan/util/cmp_texturevk.cpp @@ -355,9 +355,6 @@ VkFormat MIP2VK_Format(MipSet* pMipsTexture) { case CMP_FORMAT_BC7: m_VKnum = VK_FORMAT_BC7_UNORM_BLOCK; break; - case CMP_FORMAT_BC7_SRGB: - m_VKnum = VK_FORMAT_BC7_SRGB_BLOCK; - break; case CMP_FORMAT_ETC_RGB: case CMP_FORMAT_ETC2_RGB: m_VKnum = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; diff --git a/applications/_plugins/cgpudecode/directx/gpu_directx.cpp b/applications/_plugins/cgpudecode/directx/gpu_directx.cpp index 4632bada8..5560db509 100644 --- a/applications/_plugins/cgpudecode/directx/gpu_directx.cpp +++ b/applications/_plugins/cgpudecode/directx/gpu_directx.cpp @@ -614,9 +614,6 @@ DXGI_FORMAT GPU_DirectX::CMP2DXGIFormat(CMP_FORMAT cmp_format) case CMP_FORMAT_BC7: dxgi_format = DXGI_FORMAT_BC7_UNORM; break; - case CMP_FORMAT_BC7_SRGB: - dxgi_format = DXGI_FORMAT_BC7_UNORM_SRGB; - break; // Unknown compression mapping to Direct X #if (OPTION_BUILD_ASTC == 1) diff --git a/applications/_plugins/cgpudecode/opengl/gpu_opengl.cpp b/applications/_plugins/cgpudecode/opengl/gpu_opengl.cpp index 889229486..080825d0a 100644 --- a/applications/_plugins/cgpudecode/opengl/gpu_opengl.cpp +++ b/applications/_plugins/cgpudecode/opengl/gpu_opengl.cpp @@ -171,9 +171,6 @@ unsigned int GPU_OpenGL::MIP2OLG_Format(const CMP_Texture* pSourceTexture) case CMP_FORMAT_BC7: m_GLnum = GL_COMPRESSED_RGBA_BPTC_UNORM; break; - case CMP_FORMAT_BC7_SRGB: - m_GLnum = GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM; - break; case CMP_FORMAT_ETC_RGB: case CMP_FORMAT_ETC2_RGB: m_GLnum = GL_COMPRESSED_RGB8_ETC2; diff --git a/applications/_plugins/cgpudecode/vulkan/gpu_vulkan.cpp b/applications/_plugins/cgpudecode/vulkan/gpu_vulkan.cpp index 30f4a3b1e..eb034f070 100644 --- a/applications/_plugins/cgpudecode/vulkan/gpu_vulkan.cpp +++ b/applications/_plugins/cgpudecode/vulkan/gpu_vulkan.cpp @@ -956,9 +956,6 @@ VkFormat GPU_Vulkan::MIP2VK_Format(const CMP_Texture* pSourceTexture) case CMP_FORMAT_BC7: m_VKnum = VK_FORMAT_BC7_UNORM_BLOCK; break; - case CMP_FORMAT_BC7_SRGB: - m_VKnum = VK_FORMAT_BC7_SRGB_BLOCK; - break; case CMP_FORMAT_ETC_RGB: case CMP_FORMAT_ETC2_RGB: m_VKnum = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; diff --git a/applications/_plugins/cimage/dds/dds_dx10.cpp b/applications/_plugins/cimage/dds/dds_dx10.cpp index db0f8d812..3051cadf2 100644 --- a/applications/_plugins/cimage/dds/dds_dx10.cpp +++ b/applications/_plugins/cimage/dds/dds_dx10.cpp @@ -238,14 +238,9 @@ TC_PluginError LoadDDS_DX10(FILE* pFile, DDSD2* pDDSD, MipSet* pMipSet) case DXGI_FORMAT_BC7_TYPELESS: case DXGI_FORMAT_BC7_UNORM: - pMipSet->m_compressed = true; - pMipSet->m_format = CMP_FORMAT_BC7; - err = LoadDDS_DX10_FourCC(pFile, pDDSD, pMipSet, CMP_FOURCC_DX10); - break; - case DXGI_FORMAT_BC7_UNORM_SRGB: pMipSet->m_compressed = true; - pMipSet->m_format = CMP_FORMAT_BC7_SRGB; + pMipSet->m_format = CMP_FORMAT_BC7; err = LoadDDS_DX10_FourCC(pFile, pDDSD, pMipSet, CMP_FOURCC_DX10); break; @@ -398,8 +393,6 @@ DXGI_FORMAT GetDXGIFormat(const MipSet* pMipSet) return DXGI_FORMAT_BC5_UNORM; case CMP_FORMAT_BC7: return DXGI_FORMAT_BC7_UNORM; - case CMP_FORMAT_BC7_SRGB: - return DXGI_FORMAT_BC7_UNORM_SRGB; // case CMP_FORMAT_ASTC: return DXGI_FORMAT_????; Not yet supported as of Jun 24 2015 } } @@ -483,7 +476,6 @@ TC_PluginError SaveDDS_DX10(FILE* pFile, const MipSet* pMipSet) ddsd2.lPitch = ddsd2.dwWidth * 4; break; case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: default: ddsd2.lPitch = ddsd2.dwWidth * 4; break; diff --git a/applications/_plugins/cimage/ktx/ktx1.cpp b/applications/_plugins/cimage/ktx/ktx1.cpp index e80b1432b..d0fa34a7b 100644 --- a/applications/_plugins/cimage/ktx/ktx1.cpp +++ b/applications/_plugins/cimage/ktx/ktx1.cpp @@ -465,10 +465,6 @@ int Plugin_KTX::TC_PluginFileLoadTexture(const char* pszFilename, MipSet* pMipSe pMipSet->m_format = CMP_FORMAT_BC7; pMipSet->m_TextureDataType = TDT_ARGB; break; - case RGB_BP_SRGB: - pMipSet->m_format = CMP_FORMAT_BC7_SRGB; - pMipSet->m_TextureDataType = TDT_ARGB; - break; case RGB_BP_UNSIGNED_FLOAT: pMipSet->m_format = CMP_FORMAT_BC6H; pMipSet->m_TextureDataType = TDT_ARGB; @@ -1105,7 +1101,6 @@ int Plugin_KTX::TC_PluginFileSaveTexture(const char* pszFilename, MipSet* pMipSe case CMP_FORMAT_BC6H: case CMP_FORMAT_BC6H_SF: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_DXT1: case CMP_FORMAT_DXT3: case CMP_FORMAT_DXT5: @@ -1256,9 +1251,6 @@ int Plugin_KTX::TC_PluginFileSaveTexture(const char* pszFilename, MipSet* pMipSe case CMP_FORMAT_BC7: textureinfo.glInternalFormat = RGB_BP_UNorm; break; - case CMP_FORMAT_BC7_SRGB: - textureinfo.glInternalFormat = RGB_BP_SRGB; - break; case CMP_FORMAT_ATI1N: textureinfo.glInternalFormat = R_ATI1N_UNorm; break; diff --git a/applications/_plugins/cimage/ktx/ktx1.h b/applications/_plugins/cimage/ktx/ktx1.h index 543d6fff5..bf8304668 100644 --- a/applications/_plugins/cimage/ktx/ktx1.h +++ b/applications/_plugins/cimage/ktx/ktx1.h @@ -164,7 +164,6 @@ enum scanline_copy_method #define RGB_BP_UNSIGNED_FLOAT 0x8E8F // GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB //bc6 #define RGB_BP_SIGNED_FLOAT 0x8E8E // GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB #define RGB_BP_UNorm 0x8E8C // GL_COMPRESSED_RGBA_BPTC_UNORM_ARB //bc7 -#define RGB_BP_SRGB 0x8E8D // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB //bc7_srgb #define COMPRESSED_RED_RGTC1 0x8DBB //bc4 #define COMPRESSED_RG_RGTC2 0x8DBD //bc5 ATI2_XY diff --git a/applications/_plugins/cimage/ktx2/ktx2.cpp b/applications/_plugins/cimage/ktx2/ktx2.cpp index 0ce65eea0..08743ce7e 100644 --- a/applications/_plugins/cimage/ktx2/ktx2.cpp +++ b/applications/_plugins/cimage/ktx2/ktx2.cpp @@ -217,9 +217,6 @@ int Plugin_KTX2::TC_PluginFileLoadTexture(const char* pszFilename, MipSet* pMipS case VK_FORMAT_BC7_UNORM_BLOCK: pMipSet->m_format = CMP_FORMAT_BC7; break; - case VK_FORMAT_BC7_SRGB_BLOCK: - pMipSet->m_format = CMP_FORMAT_BC7_SRGB; - break; case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: pMipSet->m_format = CMP_FORMAT_ETC2_RGB; // Skip ETC as ETC2 is backward comp break; @@ -852,10 +849,6 @@ int Plugin_KTX2::TC_PluginFileSaveTexture(const char* pszFilename, MipSet* pMipS // RGB_BP_UNorm; textureCreateInfo.vkFormat = VK_FORMAT_BC7_UNORM_BLOCK; break; - case CMP_FORMAT_BC7_SRGB: - // RGB_BP_SRGB; - textureCreateInfo.vkFormat = VK_FORMAT_BC7_SRGB_BLOCK; - break; //case CMP_FORMAT_ATI1N: // // COMPRESSED_FORMAT_ATI1N_UNorm_TMP; // textureCreateInfo.vkFormat = VK_FORMAT_BC4_UNORM_BLOCK; diff --git a/applications/_plugins/cimage/ktx2/ktx2.h b/applications/_plugins/cimage/ktx2/ktx2.h index 3f1202e2c..949f6129b 100644 --- a/applications/_plugins/cimage/ktx2/ktx2.h +++ b/applications/_plugins/cimage/ktx2/ktx2.h @@ -91,7 +91,6 @@ extern void* make_Plugin_KTX2(); #define RGB_BP_UNSIGNED_FLOAT 0x8E8F // GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB //bc6 #define RGB_BP_SIGNED_FLOAT 0x8E8E // GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB #define RGB_BP_UNorm 0x8E8C // GL_COMPRESSED_RGBA_BPTC_UNORM_ARB //bc7 -#define RGB_BP_SRGB 0x8E8D // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB //bc7_srgb #define ATC_RGB_AMD 0x8C92 #define ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 #define ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE diff --git a/applications/_plugins/cmp_gpu/directx/compute_directx.cpp b/applications/_plugins/cmp_gpu/directx/compute_directx.cpp index acef9b257..f6a6e3de4 100644 --- a/applications/_plugins/cmp_gpu/directx/compute_directx.cpp +++ b/applications/_plugins/cmp_gpu/directx/compute_directx.cpp @@ -1022,7 +1022,6 @@ HRESULT CDirectX::GPU_Encode(ID3D11Buffer** ppDstTextureAsBufOut, int miplevel) case DXGI_FORMAT_BC6H_UF16: case DXGI_FORMAT_BC6H_SF16: case DXGI_FORMAT_BC7_UNORM: - case DXGI_FORMAT_BC7_UNORM_SRGB: default: sbOutDesc.StructureByteStride = sizeof(OutCompressedStruct128Bits); // 16 Bytes sbOutDesc.ByteWidth = NumOfBlocks * sizeof(OutCompressedStruct128Bits); @@ -1651,10 +1650,6 @@ CMP_ERROR CDirectX::Compress(KernelOptions* KernelOptions, MipSet& srcTexture, M m_fmtEncode = DXGI_FORMAT_BC6H_SF16; m_activeEncoder = ACTIVE_ENCODER_BC6; break; - case CMP_FORMAT_BC7_SRGB: - m_fmtEncode = DXGI_FORMAT_BC7_UNORM_SRGB; - m_activeEncoder = ACTIVE_ENCODER_BC7; - break; default: case CMP_FORMAT_BC7: m_fmtEncode = DXGI_FORMAT_BC7_UNORM; diff --git a/applications/_plugins/common/atiformats.cpp b/applications/_plugins/common/atiformats.cpp index c0a25b28e..1bcf47792 100644 --- a/applications/_plugins/common/atiformats.cpp +++ b/applications/_plugins/common/atiformats.cpp @@ -97,7 +97,6 @@ CMP_FormatDesc g_FormatDesc[] = { {CMP_FORMAT_BC6H, "BC6H"}, {CMP_FORMAT_BC6H_SF, "BC6H_SF"}, {CMP_FORMAT_BC7, "BC7"}, - {CMP_FORMAT_BC7_SRGB, "BC7_SRGB"}, {CMP_FORMAT_DXT1, "DXT1"}, {CMP_FORMAT_DXT3, "DXT3"}, @@ -323,9 +322,6 @@ void CMP_API CMP_Format2FourCC(CMP_FORMAT format, MipSet* pMipSet) case CMP_FORMAT_BC7: pMipSet->m_dwFourCC = CMP_FOURCC_DX10; break; - case CMP_FORMAT_BC7_SRGB: - pMipSet->m_dwFourCC = CMP_FOURCC_DX10; - break; #if (OPTION_BUILD_ASTC == 1) case CMP_FORMAT_ASTC: pMipSet->m_dwFourCC = CMP_FOURCC_DX10; @@ -472,7 +468,6 @@ CMP_BOOL CMP_API CMP_IsCompressedFormat(CMP_FORMAT format) case CMP_FORMAT_BC6H: case CMP_FORMAT_BC6H_SF: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_DXT1: case CMP_FORMAT_DXT3: case CMP_FORMAT_DXT5: @@ -610,7 +605,6 @@ CMP_BOOL CMP_API CMP_IsValidFormat(CMP_FORMAT InFormat) case CMP_FORMAT_BC6H: case CMP_FORMAT_BC6H_SF: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_ATI1N: case CMP_FORMAT_ATI2N: case CMP_FORMAT_ATI2N_XY: @@ -799,8 +793,6 @@ static CMP_FORMAT GetFormat(CMP_DWORD dwFourCC) return CMP_FORMAT_BC6H; case CMP_FOURCC_BC7: return CMP_FORMAT_BC7; - case CMP_FOURCC_BC7_SRGB: - return CMP_FORMAT_BC7_SRGB; #if (OPTION_BUILD_ASTC == 1) case CMP_FOURCC_ASTC: return CMP_FORMAT_ASTC; @@ -885,4 +877,4 @@ CMP_FORMAT GetFormat(MipSet* pMipSet) default: return CMP_FORMAT_Unknown; } -} +} \ No newline at end of file diff --git a/applications/_plugins/common/cmdline.cpp b/applications/_plugins/common/cmdline.cpp index 2d5da23b1..6bec772db 100644 --- a/applications/_plugins/common/cmdline.cpp +++ b/applications/_plugins/common/cmdline.cpp @@ -183,8 +183,7 @@ static inline bool IsFileModel(const std::string& sourceFile) static inline bool IsFormatBCN(CMP_FORMAT format) { return format == CMP_FORMAT_BC1 || format == CMP_FORMAT_BC2 || format == CMP_FORMAT_BC3 || format == CMP_FORMAT_BC4 || format == CMP_FORMAT_BC4_S || - format == CMP_FORMAT_BC5 || format == CMP_FORMAT_BC5_S || format == CMP_FORMAT_BC6H || format == CMP_FORMAT_BC6H_SF || format == CMP_FORMAT_BC7 || - format == CMP_FORMAT_BC7_SRGB; + format == CMP_FORMAT_BC5 || format == CMP_FORMAT_BC5_S || format == CMP_FORMAT_BC6H || format == CMP_FORMAT_BC6H_SF || format == CMP_FORMAT_BC7; } static inline bool IsProcessingBRLG(const CCmdLineParamaters& params) @@ -2058,7 +2057,6 @@ bool SVMInitCodec(KernelOptions* options) case CMP_FORMAT_BC1: case CMP_FORMAT_DXT1: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: #if (OPTION_BUILD_ASTC == 1) case CMP_FORMAT_ASTC: #endif @@ -3280,7 +3278,7 @@ int ProcessCMDLine(CMP_Feedback_Proc pFeedbackProc, MipSet* p_userMipSetIn) if (destFormat == CMP_FORMAT_BC1 || destFormat == CMP_FORMAT_BC4 || destFormat == CMP_FORMAT_BC4_S) bytesPerBlock = 8; else if (destFormat == CMP_FORMAT_BC2 || destFormat == CMP_FORMAT_BC3 || destFormat == CMP_FORMAT_BC5 || destFormat == CMP_FORMAT_BC5_S || - destFormat == CMP_FORMAT_BC6H || destFormat == CMP_FORMAT_BC6H_SF || destFormat == CMP_FORMAT_BC7 || destFormat == CMP_FORMAT_BC7_SRGB) + destFormat == CMP_FORMAT_BC6H || destFormat == CMP_FORMAT_BC6H_SF || destFormat == CMP_FORMAT_BC7) bytesPerBlock = 16; CMP_DWORD remainingSize = destMipSet.dwDataSize; @@ -3531,7 +3529,7 @@ int ProcessCMDLine(CMP_Feedback_Proc pFeedbackProc, MipSet* p_userMipSetIn) if ((g_CmdPrams.CompressOptions.fquality > 0.00f) && (g_CmdPrams.CompressOptions.fquality < 0.01f)) { // set default max quality for fast processing codecs - if ((destFormat != CMP_FORMAT_BC7_SRGB) && (destFormat != CMP_FORMAT_BC7) && (destFormat != CMP_FORMAT_BC6H) && (destFormat != CMP_FORMAT_BC6H_SF)) + if ((destFormat != CMP_FORMAT_BC7) && (destFormat != CMP_FORMAT_BC6H) && (destFormat != CMP_FORMAT_BC6H_SF)) { g_CmdPrams.CompressOptions.fquality = 1.0f; } diff --git a/applications/_plugins/common/codec_common.cpp b/applications/_plugins/common/codec_common.cpp index ba4a08f77..ff7d881e2 100644 --- a/applications/_plugins/common/codec_common.cpp +++ b/applications/_plugins/common/codec_common.cpp @@ -116,8 +116,6 @@ CodecType GetCodecType(CMP_FORMAT format) return CT_BC6H_SF; case CMP_FORMAT_BC7: return CT_BC7; - case CMP_FORMAT_BC7_SRGB: - return CT_BC7_SRGB; #if (OPTION_BUILD_ASTC == 1) case CMP_FORMAT_ASTC: return CT_ASTC; @@ -241,7 +239,6 @@ CMP_DWORD CalcBufferSize(CodecType nCodecType, CMP_DWORD dwWidth, CMP_DWORD dwHe // Block size is 4x4 and 128 bits per block case CT_BC7: - case CT_BC7_SRGB: dwWidth = ((dwWidth + 3) / 4) * 4; dwHeight = ((dwHeight + 3) / 4) * 4; buffsize = dwWidth * dwHeight; @@ -299,4 +296,4 @@ CMP_DWORD CalcBufferSize(CodecType nCodecType, CMP_DWORD dwWidth, CMP_DWORD dwHe } return buffsize; -} +} \ No newline at end of file diff --git a/applications/_plugins/common/codec_common.h b/applications/_plugins/common/codec_common.h index 5fd8c4e25..b34190abb 100644 --- a/applications/_plugins/common/codec_common.h +++ b/applications/_plugins/common/codec_common.h @@ -63,7 +63,6 @@ typedef enum _CodecType CT_BC6H, CT_BC6H_SF, CT_BC7, - CT_BC7_SRGB, #if (OPTION_BUILD_ASTC == 1) CT_ASTC, #endif @@ -86,4 +85,4 @@ typedef enum _CODECError CodecType GetCodecType(CMP_FORMAT format); CMP_DWORD CalcBufferSize(CodecType nCodecType, CMP_DWORD dwWidth, CMP_DWORD dwHeight, CMP_BYTE nBlockWidth, CMP_BYTE nBlockHeight); -#endif +#endif \ No newline at end of file diff --git a/applications/_plugins/common/texture.h b/applications/_plugins/common/texture.h index 1c100ce10..8f8bf45a7 100644 --- a/applications/_plugins/common/texture.h +++ b/applications/_plugins/common/texture.h @@ -118,8 +118,6 @@ extern "C" { #define CMP_FOURCC_BC6H CMP_MAKEFOURCC('B', 'C', '6', 'H') #define CMP_FOURCC_BC7 CMP_MAKEFOURCC('B', 'C', '7', 'x') -#define CMP_FOURCC_BC7_SRGB CMP_MAKEFOURCC('B', 'C', '7', 's') - #if (OPTION_BUILD_ASTC == 1) #define CMP_FOURCC_ASTC CMP_MAKEFOURCC('A', 'S', 'T', 'C') #endif diff --git a/applications/_plugins/common/textureio.cpp b/applications/_plugins/common/textureio.cpp index e15ba66a8..1ff6d3092 100644 --- a/applications/_plugins/common/textureio.cpp +++ b/applications/_plugins/common/textureio.cpp @@ -768,7 +768,6 @@ int AMDSaveMIPSTextureImage(const char* DestFile, MipSet* MipSetIn, bool use_OCV case CMP_FORMAT_ASTC: #endif case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_BC6H: case CMP_FORMAT_BC6H_SF: case CMP_FORMAT_ETC_RGB: diff --git a/cmp_compressonatorlib/bc7/codec_bc7.cpp b/cmp_compressonatorlib/bc7/codec_bc7.cpp index bebf5d2af..ea32dee61 100644 --- a/cmp_compressonatorlib/bc7/codec_bc7.cpp +++ b/cmp_compressonatorlib/bc7/codec_bc7.cpp @@ -83,8 +83,8 @@ unsigned int BC7ThreadProcEncode(void* param) // Construction/Destruction ////////////////////////////////////////////////////////////////////////////// -CCodec_BC7::CCodec_BC7(CodecType codecType) - : CCodec_DXTC(codecType) { +CCodec_BC7::CCodec_BC7() + : CCodec_DXTC(CT_BC7) { m_LibraryInitialized = false; diff --git a/cmp_compressonatorlib/bc7/codec_bc7.h b/cmp_compressonatorlib/bc7/codec_bc7.h index f688eb204..4493ee358 100644 --- a/cmp_compressonatorlib/bc7/codec_bc7.h +++ b/cmp_compressonatorlib/bc7/codec_bc7.h @@ -58,7 +58,7 @@ struct BC7EncodeThreadParam class CCodec_BC7 : public CCodec_DXTC { public: - CCodec_BC7(CodecType codecType); + CCodec_BC7(); ~CCodec_BC7(); virtual bool SetParameter(const CMP_CHAR* pszParamName, CMP_CHAR* sValue); diff --git a/cmp_compressonatorlib/common/codec.cpp b/cmp_compressonatorlib/common/codec.cpp index 6ef1e80d6..547c40f0e 100644 --- a/cmp_compressonatorlib/common/codec.cpp +++ b/cmp_compressonatorlib/common/codec.cpp @@ -234,8 +234,7 @@ CCodec* CreateCodec(CodecType nCodecType) case CT_BC6H_SF: return new CCodec_BC6H(nCodecType); case CT_BC7: - case CT_BC7_SRGB: - return new CCodec_BC7(nCodecType); + return new CCodec_BC7; #if (OPTION_BUILD_ASTC == 1) case CT_ASTC: return new CCodec_ASTC; diff --git a/cmp_compressonatorlib/compress.cpp b/cmp_compressonatorlib/compress.cpp index f3b558f9e..972ec263b 100644 --- a/cmp_compressonatorlib/compress.cpp +++ b/cmp_compressonatorlib/compress.cpp @@ -164,7 +164,6 @@ static void CMP_PrepareCMPSourceForIMG_Destination(CMP_Texture* destTexture, CMP #endif case CMP_FORMAT_BC6H: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_GT: case CMP_FORMAT_ETC_RGB: case CMP_FORMAT_ETC2_RGB: @@ -237,7 +236,6 @@ CMP_ERROR CodecCompressTexture(const CMP_Texture* srcTexture, CMP_Texture* destT switch (destType) { case CT_BC7: - case CT_BC7_SRGB: codec->SetParameter("MultiThreading", (CMP_DWORD)!options->bDisableMultiThreading); if (!options->bDisableMultiThreading) @@ -519,8 +517,6 @@ CMP_ERROR CodecCompressTextureThreaded(const CMP_Texture* srcTexture, // Note function should not be called for the following Codecs.... if (destType == CT_BC7) return CMP_ABORTED; - if (destType == CT_BC7_SRGB) - return CMP_ABORTED; #ifdef USE_APC if (destType == CT_APC) return CMP_ABORTED; diff --git a/cmp_compressonatorlib/compressonator.cpp b/cmp_compressonatorlib/compressonator.cpp index d63fc6549..f9f068f19 100644 --- a/cmp_compressonatorlib/compressonator.cpp +++ b/cmp_compressonatorlib/compressonator.cpp @@ -144,7 +144,6 @@ static void CMP_PrepareSourceForCMP_Destination(CMP_Texture* pTexture, CMP_FORMA #endif case CMP_FORMAT_BC6H: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_GT: case CMP_FORMAT_ETC_RGB: case CMP_FORMAT_ETC2_RGB: @@ -197,7 +196,6 @@ static void CMP_PrepareSourceForCMP_Destination(CMP_Texture* pTexture, CMP_FORMA #endif case CMP_FORMAT_BC6H: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_ETC_RGB: case CMP_FORMAT_ETC2_RGB: case CMP_FORMAT_ETC2_SRGB: @@ -246,7 +244,6 @@ static void CMP_PrepareSourceForCMP_Destination(CMP_Texture* pTexture, CMP_FORMA #endif case CMP_FORMAT_BC6H: case CMP_FORMAT_BC7: - case CMP_FORMAT_BC7_SRGB: case CMP_FORMAT_ETC_RGB: case CMP_FORMAT_ETC2_RGB: case CMP_FORMAT_ETC2_SRGB: @@ -385,7 +382,7 @@ CMP_ERROR CMP_API CMP_ConvertTexture(CMP_Texture* pSourceTexture, #if (OPTION_BUILD_ASTC == 1) (destType != CT_ASTC) && #endif - (destType != CT_BC7) && (destType != CT_BC7_SRGB) && (destType != CT_BC6H) && (destType != CT_BC6H_SF) + (destType != CT_BC7) && (destType != CT_BC6H) && (destType != CT_BC6H_SF) #ifdef USE_APC && (destType != CT_APC) #endif diff --git a/cmp_compressonatorlib/compressonator.h b/cmp_compressonatorlib/compressonator.h index 18faa30bd..b78cdd918 100644 --- a/cmp_compressonatorlib/compressonator.h +++ b/cmp_compressonatorlib/compressonator.h @@ -155,10 +155,9 @@ typedef enum // compressed texture format for Microsoft DirectX10. Identical to ATI2N_XY. Eight bits per pixel. CMP_FORMAT_BC5_S = 0x1051, // DXGI_FORMAT_BC5_SNORM VK_FORMAT_BC5_SNORM_BLOCK GL_COMPRESSED_RGBA_BPTC_UNORM A two component // compressed texture format for Microsoft DirectX10. Identical to ATI2N_XY. Eight bits per pixel. - CMP_FORMAT_BC6H = 0x0061, // DXGI_FORMAT_BC6H_UF16 VK_FORMAT_BC6H_UFLOAT_BLOCK GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT BC6H compressed texture format (UF) - CMP_FORMAT_BC6H_SF = 0x1061, // DXGI_FORMAT_BC6H_SF16 VK_FORMAT_BC6H_SFLOAT_BLOCK GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT BC6H compressed texture format (SF) - CMP_FORMAT_BC7 = 0x0071, // DXGI_FORMAT_BC7_UNORM VK_FORMAT_BC7_UNORM_BLOCK GL_COMPRESSED_RGBA_BPTC_UNORM BC7 compressed texture format - CMP_FORMAT_BC7_SRGB = 0x0072, // DXGI_FORMAT_BC7_UNORM_SRGB VK_FORMAT_BC7_SRGB_BLOCK GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM BC7 compressed texture format + CMP_FORMAT_BC6H = 0x0061, // DXGI_FORMAT_BC6H_UF16 VK_FORMAT_BC6H_UFLOAT_BLOCK GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT BC6H compressed texture format (UF) + CMP_FORMAT_BC6H_SF = 0x1061, // DXGI_FORMAT_BC6H_SF16 VK_FORMAT_BC6H_SFLOAT_BLOCK GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT BC6H compressed texture format (SF) + CMP_FORMAT_BC7 = 0x0071, // DXGI_FORMAT_BC7_UNORM VK_FORMAT_BC7_UNORM_BLOCK GL_COMPRESSED_RGBA_BPTC_UNORM BC7 compressed texture format CMP_FORMAT_ATI1N = 0x0141, // DXGI_FORMAT_BC4_UNORM VK_FORMAT_BC4_UNORM_BLOCK GL_COMPRESSED_RED_RGTC1 Single component // compression format using the same technique as DXT5 alpha. Four bits per pixel. diff --git a/examples/common/dds_helpers.cpp b/examples/common/dds_helpers.cpp index 3c595bc90..46db0a9ca 100644 --- a/examples/common/dds_helpers.cpp +++ b/examples/common/dds_helpers.cpp @@ -195,7 +195,6 @@ CMP_FormatDesc g_DDSFormatDesc[] = { {CMP_FORMAT_BC5_S, ("BC5_S")}, {CMP_FORMAT_BC6H, ("BC6H")}, {CMP_FORMAT_BC7, ("BC7")}, - {CMP_FORMAT_BC7_SRGB, ("BC7s")}, {CMP_FORMAT_ATC_RGB, ("ATC_RGB")}, {CMP_FORMAT_ATC_RGBA_Explicit, ("ATC_RGBA_Explicit")}, {CMP_FORMAT_ATC_RGBA_Interpolated, ("ATC_RGBA_Interpolated")}, @@ -894,7 +893,7 @@ void SaveDDSFile(const char* pszFile, CMP_Texture& texture) // Check to save the data using DX10 file format (BC7 is used as an example of what is supported // and can be expanded to include other formats - if ((texture.format == CMP_FORMAT_BC7) || (texture.format == CMP_FORMAT_BC7_SRGB) || (texture.format == CMP_FORMAT_BC6H) || (texture.format == CMP_FORMAT_BC6H_SF)) + if ((texture.format == CMP_FORMAT_BC7) || (texture.format == CMP_FORMAT_BC6H) || (texture.format == CMP_FORMAT_BC6H_SF)) { ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC; ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D', 'X', '1', '0'); @@ -908,8 +907,6 @@ void SaveDDSFile(const char* pszFile, CMP_Texture& texture) if (texture.format == CMP_FORMAT_BC7) HeaderDDS10.dxgiFormat = DXGI_FORMAT_BC7_UNORM; - else if (texture.format == CMP_FORMAT_BC7_SRGB) - HeaderDDS10.dxgiFormat = DXGI_FORMAT_BC7_UNORM_SRGB; else if (texture.format == CMP_FORMAT_BC6H) HeaderDDS10.dxgiFormat = DXGI_FORMAT_BC6H_UF16; else if (texture.format == CMP_FORMAT_BC6H_SF)