mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Update blend constants only when they have actually changed
Reduces number of redundant state changes in Resonance of Fate.
This commit is contained in:
parent
035fe3e30b
commit
db2880acfd
@ -16,6 +16,16 @@ namespace dxvk {
|
||||
*/
|
||||
struct DxvkBlendConstants {
|
||||
float r, g, b, a;
|
||||
|
||||
bool operator == (const DxvkBlendConstants& other) const {
|
||||
return this->r == other.r && this->g == other.g
|
||||
&& this->b == other.b && this->a == other.a;
|
||||
}
|
||||
|
||||
bool operator != (const DxvkBlendConstants& other) const {
|
||||
return this->r != other.r || this->g != other.g
|
||||
|| this->b != other.b || this->a != other.a;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -1406,15 +1406,19 @@ namespace dxvk {
|
||||
|
||||
void DxvkContext::setBlendConstants(
|
||||
const DxvkBlendConstants& blendConstants) {
|
||||
m_state.om.blendConstants = blendConstants;
|
||||
m_flags.set(DxvkContextFlag::GpDirtyBlendConstants);
|
||||
if (m_state.om.blendConstants != blendConstants) {
|
||||
m_state.om.blendConstants = blendConstants;
|
||||
m_flags.set(DxvkContextFlag::GpDirtyBlendConstants);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::setStencilReference(
|
||||
const uint32_t reference) {
|
||||
m_state.om.stencilReference = reference;
|
||||
m_flags.set(DxvkContextFlag::GpDirtyStencilRef);
|
||||
if (m_state.om.stencilReference != reference) {
|
||||
m_state.om.stencilReference = reference;
|
||||
m_flags.set(DxvkContextFlag::GpDirtyStencilRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user