mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Add method to swizzle clear color values
This commit is contained in:
parent
3efec8960c
commit
0b61901424
@ -150,6 +150,21 @@ namespace dxvk::util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VkClearColorValue swizzleClearColor(
|
||||||
|
VkClearColorValue color,
|
||||||
|
VkComponentMapping mapping) {
|
||||||
|
VkClearColorValue result;
|
||||||
|
auto swizzles = &mapping.r;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < 4; i++) {
|
||||||
|
uint32_t index = getComponentIndex(swizzles[i], i);
|
||||||
|
result.uint32[i] = color.uint32[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool isBlendConstantBlendFactor(VkBlendFactor factor) {
|
bool isBlendConstantBlendFactor(VkBlendFactor factor) {
|
||||||
return factor == VK_BLEND_FACTOR_CONSTANT_COLOR
|
return factor == VK_BLEND_FACTOR_CONSTANT_COLOR
|
||||||
|| factor == VK_BLEND_FACTOR_CONSTANT_ALPHA
|
|| factor == VK_BLEND_FACTOR_CONSTANT_ALPHA
|
||||||
|
@ -223,6 +223,10 @@ namespace dxvk::util {
|
|||||||
VkComponentSwizzle component,
|
VkComponentSwizzle component,
|
||||||
uint32_t identity);
|
uint32_t identity);
|
||||||
|
|
||||||
|
VkClearColorValue swizzleClearColor(
|
||||||
|
VkClearColorValue color,
|
||||||
|
VkComponentMapping mapping);
|
||||||
|
|
||||||
bool isBlendConstantBlendFactor(
|
bool isBlendConstantBlendFactor(
|
||||||
VkBlendFactor factor);
|
VkBlendFactor factor);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user