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:
parent
e2340d7224
commit
2fabc90f46
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user