1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxvk] Add methods to check which dynamic states a pipeline uses

This commit is contained in:
Philip Rebohle 2019-01-16 19:31:38 +01:00
parent 59462f3231
commit 190f114449
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 34 additions and 1 deletions

View File

@ -47,6 +47,28 @@ namespace dxvk {
bool operator == (const DxvkGraphicsPipelineStateInfo& other) const; bool operator == (const DxvkGraphicsPipelineStateInfo& other) const;
bool operator != (const DxvkGraphicsPipelineStateInfo& other) const; bool operator != (const DxvkGraphicsPipelineStateInfo& other) const;
bool useDynamicStencilRef() const {
return dsEnableStencilTest;
}
bool useDynamicDepthBias() const {
return rsDepthBiasEnable;
}
bool useDynamicBlendConstants() const {
bool result = false;
for (uint32_t i = 0; i < MaxNumRenderTargets && !result; i++) {
result |= omBlendAttachments[i].blendEnable
&& (util::isBlendConstantBlendFactor(omBlendAttachments[i].srcColorBlendFactor)
|| util::isBlendConstantBlendFactor(omBlendAttachments[i].dstColorBlendFactor)
|| util::isBlendConstantBlendFactor(omBlendAttachments[i].srcAlphaBlendFactor)
|| util::isBlendConstantBlendFactor(omBlendAttachments[i].dstAlphaBlendFactor));
}
return result;
}
DxvkBindingMask bsBindingMask; DxvkBindingMask bsBindingMask;
VkPrimitiveTopology iaPrimitiveTopology; VkPrimitiveTopology iaPrimitiveTopology;

View File

@ -150,6 +150,14 @@ namespace dxvk::util {
} }
bool isBlendConstantBlendFactor(VkBlendFactor factor) {
return factor == VK_BLEND_FACTOR_CONSTANT_COLOR
|| factor == VK_BLEND_FACTOR_CONSTANT_ALPHA
|| factor == VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR
|| factor == VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA;
}
bool isDualSourceBlendFactor(VkBlendFactor factor) { bool isDualSourceBlendFactor(VkBlendFactor factor) {
return factor == VK_BLEND_FACTOR_SRC1_COLOR return factor == VK_BLEND_FACTOR_SRC1_COLOR
|| factor == VK_BLEND_FACTOR_SRC1_ALPHA || factor == VK_BLEND_FACTOR_SRC1_ALPHA

View File

@ -212,6 +212,9 @@ namespace dxvk::util {
VkComponentSwizzle component, VkComponentSwizzle component,
uint32_t identity); uint32_t identity);
bool isBlendConstantBlendFactor(
VkBlendFactor factor);
bool isDualSourceBlendFactor( bool isDualSourceBlendFactor(
VkBlendFactor factor); VkBlendFactor factor);