| 285 | } |
| 286 | |
| 287 | static VkComponentSwizzle resolveComponentSwizzle( |
| 288 | VkComponentSwizzle swizzle, |
| 289 | VkComponentMapping dstMapping, |
| 290 | VkComponentMapping srcMapping) |
| 291 | { |
| 292 | VkComponentSwizzle dstSwizzle = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 293 | if (dstMapping.r == swizzle) |
| 294 | dstSwizzle = VK_COMPONENT_SWIZZLE_R; |
| 295 | if (dstMapping.g == swizzle) |
| 296 | dstSwizzle = VK_COMPONENT_SWIZZLE_G; |
| 297 | if (dstMapping.b == swizzle) |
| 298 | dstSwizzle = VK_COMPONENT_SWIZZLE_B; |
| 299 | if (dstMapping.a == swizzle) |
| 300 | dstSwizzle = VK_COMPONENT_SWIZZLE_A; |
| 301 | |
| 302 | switch (dstSwizzle) |
| 303 | { |
| 304 | case VK_COMPONENT_SWIZZLE_R: |
| 305 | return srcMapping.r; |
| 306 | case VK_COMPONENT_SWIZZLE_G: |
| 307 | return srcMapping.g; |
| 308 | case VK_COMPONENT_SWIZZLE_B: |
| 309 | return srcMapping.b; |
| 310 | case VK_COMPONENT_SWIZZLE_A: |
| 311 | return srcMapping.a; |
| 312 | default: |
| 313 | return VK_COMPONENT_SWIZZLE_IDENTITY; |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | VkComponentMapping resolveSrcComponentMapping( |
| 318 | VkComponentMapping dstMapping, |
no outgoing calls
no test coverage detected