3 ms·
Is all of it necessary, or is some of it extra verbose for the sake of being explicit? If you leave this blank do you get nothing? .components
by tedunangst 3y ago
Is all of it necessary, or is some of it extra verbose for the sake of being explicit? If you leave this blank do you get nothing?
.components =
{
.r = VK_COMPONENT_SWIZZLE_R,
.g = VK_COMPONENT_SWIZZLE_G,
.b = VK_COMPONENT_SWIZZLE_B,
.a = VK_COMPONENT_SWIZZLE_A,
},
- hmry 3y agoNicely spotted actually, in that specific case leaving it blank will get you the exact same result. That's because the enum has VK_COMPONENT_SWIZZLE_IDENTITY = 0, and setting everything to IDENTITY is defined to result in exactly what you expect. (r = r, g = g, ...). You can read the spec here if you want to: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkComponentSwizzle.html https://registry.khronos.org/vulkan/specs/1.3-extensions/man... Most things in Vulkan have reasonable defaults, fortunately. Still, it's best to code with the spec open on another monitor.