MCPcopy Create free account
hub / github.com/Inori/GPCS4 / resolveComponentSwizzle

Function resolveComponentSwizzle

GPCS4/Graphics/Violet/VltUtil.cpp:287–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected