1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Add fast path for rasterizer state comparison

This commit is contained in:
Philip Rebohle 2022-07-16 13:21:44 +02:00
parent e2340d7224
commit 2fabc90f46
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 12 additions and 11 deletions

View File

@ -2428,19 +2428,16 @@ namespace dxvk {
m_flags.set(DxvkContextFlag::GpDirtyRasterizerState);
}
if (m_state.gp.state.rs.depthClipEnable() != rs.depthClipEnable
|| m_state.gp.state.rs.depthBiasEnable() != rs.depthBiasEnable
|| m_state.gp.state.rs.polygonMode() != rs.polygonMode
|| m_state.gp.state.rs.sampleCount() != rs.sampleCount
|| m_state.gp.state.rs.conservativeMode() != rs.conservativeMode) {
m_state.gp.state.rs = DxvkRsInfo(
DxvkRsInfo rsInfo(
rs.depthClipEnable,
rs.depthBiasEnable,
rs.polygonMode,
rs.sampleCount,
rs.conservativeMode);
if (!m_state.gp.state.rs.eq(rsInfo)) {
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
m_state.gp.state.rs = rsInfo;
}
}

View File

@ -250,6 +250,10 @@ namespace dxvk {
return VkConservativeRasterizationModeEXT(m_conservativeMode);
}
bool eq(const DxvkRsInfo& other) const {
return !std::memcmp(this, &other, sizeof(*this));
}
private:
uint16_t m_depthClipEnable : 1;