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 {
|
struct DxvkBlendConstants {
|
||||||
float r, g, b, a;
|
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,16 +1406,20 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkContext::setBlendConstants(
|
void DxvkContext::setBlendConstants(
|
||||||
const DxvkBlendConstants& blendConstants) {
|
const DxvkBlendConstants& blendConstants) {
|
||||||
|
if (m_state.om.blendConstants != blendConstants) {
|
||||||
m_state.om.blendConstants = blendConstants;
|
m_state.om.blendConstants = blendConstants;
|
||||||
m_flags.set(DxvkContextFlag::GpDirtyBlendConstants);
|
m_flags.set(DxvkContextFlag::GpDirtyBlendConstants);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::setStencilReference(
|
void DxvkContext::setStencilReference(
|
||||||
const uint32_t reference) {
|
const uint32_t reference) {
|
||||||
|
if (m_state.om.stencilReference != reference) {
|
||||||
m_state.om.stencilReference = reference;
|
m_state.om.stencilReference = reference;
|
||||||
m_flags.set(DxvkContextFlag::GpDirtyStencilRef);
|
m_flags.set(DxvkContextFlag::GpDirtyStencilRef);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::setInputAssemblyState(const DxvkInputAssemblyState& ia) {
|
void DxvkContext::setInputAssemblyState(const DxvkInputAssemblyState& ia) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user