mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #5834 from stenzek/bc7
Support loading BC7 (BPTC) textures from DDS files
This commit is contained in:
@ -61,6 +61,7 @@ bool IsCompressedFormat(VkFormat format)
|
||||
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC2_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC3_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC7_UNORM_BLOCK:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@ -102,6 +103,9 @@ VkFormat GetVkFormatForHostTextureFormat(AbstractTextureFormat format)
|
||||
case AbstractTextureFormat::DXT5:
|
||||
return VK_FORMAT_BC3_UNORM_BLOCK;
|
||||
|
||||
case AbstractTextureFormat::BPTC:
|
||||
return VK_FORMAT_BC7_UNORM_BLOCK;
|
||||
|
||||
case AbstractTextureFormat::RGBA8:
|
||||
default:
|
||||
return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
@ -130,6 +134,7 @@ u32 GetTexelSize(VkFormat format)
|
||||
|
||||
case VK_FORMAT_BC2_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC3_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC7_UNORM_BLOCK:
|
||||
return 16;
|
||||
|
||||
default:
|
||||
@ -145,6 +150,7 @@ u32 GetBlockSize(VkFormat format)
|
||||
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC2_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC3_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC7_UNORM_BLOCK:
|
||||
return 4;
|
||||
|
||||
default:
|
||||
|
@ -248,6 +248,7 @@ void VulkanContext::PopulateBackendInfo(VideoConfig* config)
|
||||
config->backend_info.bSupportsSSAA = false; // Dependent on features.
|
||||
config->backend_info.bSupportsDepthClamp = false; // Dependent on features.
|
||||
config->backend_info.bSupportsST3CTextures = false; // Dependent on features.
|
||||
config->backend_info.bSupportsBPTCTextures = false; // Dependent on features.
|
||||
config->backend_info.bSupportsReversedDepthRange = false; // No support yet due to driver bugs.
|
||||
}
|
||||
|
||||
@ -287,7 +288,9 @@ void VulkanContext::PopulateBackendInfoFeatures(VideoConfig* config, VkPhysicalD
|
||||
(features.depthClamp == VK_TRUE && features.shaderClipDistance == VK_TRUE);
|
||||
|
||||
// textureCompressionBC implies BC1 through BC7, which is a superset of DXT1/3/5, which we need.
|
||||
config->backend_info.bSupportsST3CTextures = features.textureCompressionBC == VK_TRUE;
|
||||
const bool supports_bc = features.textureCompressionBC == VK_TRUE;
|
||||
config->backend_info.bSupportsST3CTextures = supports_bc;
|
||||
config->backend_info.bSupportsBPTCTextures = supports_bc;
|
||||
|
||||
// Our usage of primitive restart appears to be broken on AMD's binary drivers.
|
||||
// Seems to be fine on GCN Gen 1-2, unconfirmed on GCN Gen 3, causes driver resets on GCN Gen 4.
|
||||
|
Reference in New Issue
Block a user