mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
HiresTextures: Support loading BC7 (BPTC) from DDS files
This commit is contained in:
@ -31,6 +31,7 @@ size_t AbstractTexture::CalculateHostTextureLevelPitch(AbstractTextureFormat for
|
||||
return static_cast<size_t>(std::max(1u, row_length / 4)) * 8;
|
||||
case AbstractTextureFormat::DXT3:
|
||||
case AbstractTextureFormat::DXT5:
|
||||
case AbstractTextureFormat::BPTC:
|
||||
return static_cast<size_t>(std::max(1u, row_length / 4)) * 16;
|
||||
case AbstractTextureFormat::RGBA8:
|
||||
default:
|
||||
|
@ -319,6 +319,14 @@ bool ParseDDSHeader(File::IOFile& file, DDSLoadInfo* info)
|
||||
info->bytes_per_block = 16;
|
||||
needs_s3tc = true;
|
||||
}
|
||||
else if (dxt10_format == 98)
|
||||
{
|
||||
info->format = AbstractTextureFormat::BPTC;
|
||||
info->block_size = 4;
|
||||
info->bytes_per_block = 16;
|
||||
if (!g_ActiveConfig.backend_info.bSupportsBPTCTextures)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Leave all remaining formats to SOIL.
|
||||
|
@ -15,7 +15,8 @@ enum class AbstractTextureFormat : u32
|
||||
RGBA8,
|
||||
DXT1,
|
||||
DXT3,
|
||||
DXT5
|
||||
DXT5,
|
||||
BPTC
|
||||
};
|
||||
|
||||
struct TextureConfig
|
||||
|
@ -38,6 +38,7 @@ VideoConfig::VideoConfig()
|
||||
backend_info.bSupportsMultithreading = false;
|
||||
backend_info.bSupportsInternalResolutionFrameDumps = false;
|
||||
backend_info.bSupportsST3CTextures = false;
|
||||
backend_info.bSupportsBPTCTextures = false;
|
||||
|
||||
bEnableValidationLayer = false;
|
||||
bBackendMultithreading = true;
|
||||
|
@ -236,6 +236,7 @@ struct VideoConfig final
|
||||
bool bSupportsST3CTextures;
|
||||
bool bSupportsBitfield; // Needed by UberShaders, so must stay in VideoCommon
|
||||
bool bSupportsDynamicSamplerIndexing; // Needed by UberShaders, so must stay in VideoCommon
|
||||
bool bSupportsBPTCTextures;
|
||||
} backend_info;
|
||||
|
||||
// Utility
|
||||
|
Reference in New Issue
Block a user