Merge pull request #4033 from ReinUsesLisp/vk-r16ui

maxwell_to_vk: Add R16UI image format
This commit is contained in:
LC 2020-06-02 09:42:49 -04:00 committed by GitHub
commit c5de3c1059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 74 additions and 71 deletions

View File

@ -149,7 +149,7 @@ struct FormatTuple {
{VK_FORMAT_R16_SFLOAT, Attachable | Storage}, // R16F {VK_FORMAT_R16_SFLOAT, Attachable | Storage}, // R16F
{VK_FORMAT_R16_UNORM, Attachable | Storage}, // R16U {VK_FORMAT_R16_UNORM, Attachable | Storage}, // R16U
{VK_FORMAT_UNDEFINED}, // R16S {VK_FORMAT_UNDEFINED}, // R16S
{VK_FORMAT_UNDEFINED}, // R16UI {VK_FORMAT_R16_UINT, Attachable | Storage}, // R16UI
{VK_FORMAT_UNDEFINED}, // R16I {VK_FORMAT_UNDEFINED}, // R16I
{VK_FORMAT_R16G16_UNORM, Attachable | Storage}, // RG16 {VK_FORMAT_R16G16_UNORM, Attachable | Storage}, // RG16
{VK_FORMAT_R16G16_SFLOAT, Attachable | Storage}, // RG16F {VK_FORMAT_R16G16_SFLOAT, Attachable | Storage}, // RG16F

View File

@ -73,76 +73,79 @@ VkFormatFeatureFlags GetFormatFeatures(VkFormatProperties properties, FormatType
std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties( std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(
vk::PhysicalDevice physical, const vk::InstanceDispatch& dld) { vk::PhysicalDevice physical, const vk::InstanceDispatch& dld) {
static constexpr std::array formats{VK_FORMAT_A8B8G8R8_UNORM_PACK32, static constexpr std::array formats{
VK_FORMAT_A8B8G8R8_UINT_PACK32, VK_FORMAT_A8B8G8R8_UNORM_PACK32,
VK_FORMAT_A8B8G8R8_SNORM_PACK32, VK_FORMAT_A8B8G8R8_UINT_PACK32,
VK_FORMAT_A8B8G8R8_SRGB_PACK32, VK_FORMAT_A8B8G8R8_SNORM_PACK32,
VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_A8B8G8R8_SRGB_PACK32,
VK_FORMAT_A2B10G10R10_UNORM_PACK32, VK_FORMAT_B5G6R5_UNORM_PACK16,
VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A2B10G10R10_UNORM_PACK32,
VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_A1R5G5B5_UNORM_PACK16,
VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_SFLOAT,
VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32G32B32A32_UINT,
VK_FORMAT_R32G32_UINT, VK_FORMAT_R32G32_SFLOAT,
VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R32G32_UINT,
VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_UINT,
VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_R16G16B16A16_SNORM,
VK_FORMAT_R16G16_UNORM, VK_FORMAT_R16G16B16A16_UNORM,
VK_FORMAT_R16G16_SNORM, VK_FORMAT_R16G16_UNORM,
VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_R16G16_SNORM,
VK_FORMAT_R16_UNORM, VK_FORMAT_R16G16_SFLOAT,
VK_FORMAT_R8G8B8A8_SRGB, VK_FORMAT_R16_UNORM,
VK_FORMAT_R8G8_UNORM, VK_FORMAT_R16_UINT,
VK_FORMAT_R8G8_SNORM, VK_FORMAT_R8G8B8A8_SRGB,
VK_FORMAT_R8G8_UINT, VK_FORMAT_R8G8_UNORM,
VK_FORMAT_R8_UNORM, VK_FORMAT_R8G8_SNORM,
VK_FORMAT_R8_UINT, VK_FORMAT_R8G8_UINT,
VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_R8_UNORM,
VK_FORMAT_R32_SFLOAT, VK_FORMAT_R8_UINT,
VK_FORMAT_R32_UINT, VK_FORMAT_B10G11R11_UFLOAT_PACK32,
VK_FORMAT_R32_SINT, VK_FORMAT_R32_SFLOAT,
VK_FORMAT_R16_SFLOAT, VK_FORMAT_R32_UINT,
VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R32_SINT,
VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R16_SFLOAT,
VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_R16G16B16A16_SFLOAT,
VK_FORMAT_R4G4B4A4_UNORM_PACK16, VK_FORMAT_B8G8R8A8_UNORM,
VK_FORMAT_D32_SFLOAT, VK_FORMAT_B8G8R8A8_SRGB,
VK_FORMAT_D16_UNORM, VK_FORMAT_R4G4B4A4_UNORM_PACK16,
VK_FORMAT_D16_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT,
VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D16_UNORM,
VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_D16_UNORM_S8_UINT,
VK_FORMAT_BC1_RGBA_UNORM_BLOCK, VK_FORMAT_D24_UNORM_S8_UINT,
VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_D32_SFLOAT_S8_UINT,
VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK,
VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK,
VK_FORMAT_BC5_SNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK,
VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK,
VK_FORMAT_BC6H_UFLOAT_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK,
VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK,
VK_FORMAT_BC1_RGBA_SRGB_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK,
VK_FORMAT_BC2_SRGB_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK,
VK_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GB_BLOCK,
VK_FORMAT_ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
VK_FORMAT_ASTC_6x5_SRGB_BLOCK, VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32}; VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,
};
std::unordered_map<VkFormat, VkFormatProperties> format_properties; std::unordered_map<VkFormat, VkFormatProperties> format_properties;
for (const auto format : formats) { for (const auto format : formats) {
format_properties.emplace(format, physical.GetFormatProperties(format)); format_properties.emplace(format, physical.GetFormatProperties(format));