MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / to_profile

Function to_profile

framework/scene_graph/components/image/astc.cpp:99–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99inline astcenc_profile to_profile(const VkFormat format)
100{
101 switch (format)
102 {
103 case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
104 case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
105 case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
106 case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
107 case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
108 case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
109 case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
110 case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
111 case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
112 case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
113 case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
114 case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
115 case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
116 case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
117 return ASTCENC_PRF_LDR;
118 case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
119 case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
120 case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
121 case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
122 case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
123 case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
124 case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
125 case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
126 case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
127 case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
128 case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
129 case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
130 case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
131 case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
132 return ASTCENC_PRF_LDR_SRGB;
133 default:
134 throw std::runtime_error{"Invalid astc format"};
135 }
136}
137
138struct AstcHeader
139{

Callers 1

AstcMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected