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:
parent
59462f3231
commit
190f114449
@ -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;
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user