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

[dxvk] Remove cull mode and front face from pipeline state

And bump state cache version to v14.
This commit is contained in:
Philip Rebohle 2022-07-12 12:07:25 +02:00
parent d3c8d21047
commit 59475fb053
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 38 additions and 34 deletions

View File

@ -2438,8 +2438,6 @@ namespace dxvk {
rs.depthClipEnable,
rs.depthBiasEnable,
rs.polygonMode,
rs.cullMode,
rs.frontFace,
rs.sampleCount,
rs.conservativeMode);

View File

@ -395,8 +395,6 @@ namespace dxvk {
// Set up basic rasterization state
rsInfo.depthClampEnable = VK_TRUE;
rsInfo.polygonMode = state.rs.polygonMode();
rsInfo.cullMode = state.rs.cullMode();
rsInfo.frontFace = state.rs.frontFace();
rsInfo.depthBiasEnable = state.rs.depthBiasEnable();
rsInfo.lineWidth = 1.0f;
@ -1096,22 +1094,10 @@ namespace dxvk {
}
// Log rasterizer state
std::string cullMode;
switch (state.rs.cullMode()) {
case VK_CULL_MODE_NONE: cullMode = "VK_CULL_MODE_NONE"; break;
case VK_CULL_MODE_BACK_BIT: cullMode = "VK_CULL_MODE_BACK_BIT"; break;
case VK_CULL_MODE_FRONT_BIT: cullMode = "VK_CULL_MODE_FRONT_BIT"; break;
case VK_CULL_MODE_FRONT_AND_BACK: cullMode = "VK_CULL_MODE_FRONT_AND_BACK"; break;
default: cullMode = str::format(state.rs.cullMode());
}
sstr << "Rasterizer state:" << std::endl
<< " depth clip: " << (state.rs.depthClipEnable() ? "yes" : "no") << std::endl
<< " depth bias: " << (state.rs.depthBiasEnable() ? "yes" : "no") << std::endl
<< " polygon mode: " << state.rs.polygonMode() << std::endl
<< " cull mode: " << cullMode << std::endl
<< " front face: " << state.rs.frontFace() << std::endl
<< " conservative: " << (state.rs.conservativeMode() == VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT ? "no" : "yes") << std::endl;
// Log multisample state

View File

@ -221,15 +221,11 @@ namespace dxvk {
VkBool32 depthClipEnable,
VkBool32 depthBiasEnable,
VkPolygonMode polygonMode,
VkCullModeFlags cullMode,
VkFrontFace frontFace,
VkSampleCountFlags sampleCount,
VkConservativeRasterizationModeEXT conservativeMode)
: m_depthClipEnable (uint16_t(depthClipEnable)),
m_depthBiasEnable (uint16_t(depthBiasEnable)),
m_polygonMode (uint16_t(polygonMode)),
m_cullMode (uint16_t(cullMode)),
m_frontFace (uint16_t(frontFace)),
m_sampleCount (uint16_t(sampleCount)),
m_conservativeMode(uint16_t(conservativeMode)),
m_reserved (0) { }
@ -246,14 +242,6 @@ namespace dxvk {
return VkPolygonMode(m_polygonMode);
}
VkCullModeFlags cullMode() const {
return VkCullModeFlags(m_cullMode);
}
VkFrontFace frontFace() const {
return VkFrontFace(m_frontFace);
}
VkSampleCountFlags sampleCount() const {
return VkSampleCountFlags(m_sampleCount);
}
@ -267,11 +255,9 @@ namespace dxvk {
uint16_t m_depthClipEnable : 1;
uint16_t m_depthBiasEnable : 1;
uint16_t m_polygonMode : 2;
uint16_t m_cullMode : 2;
uint16_t m_frontFace : 1;
uint16_t m_sampleCount : 5;
uint16_t m_conservativeMode : 2;
uint16_t m_reserved : 2;
uint16_t m_reserved : 5;
};

View File

@ -73,6 +73,16 @@ namespace dxvk {
return true;
}
if (version < 14) {
DxvkRsInfoV13 v13;
if (!read(v13))
return false;
data = v13.convert();
return true;
}
return read(data);
}

View File

@ -52,7 +52,7 @@ namespace dxvk {
*/
struct DxvkStateCacheHeader {
char magic[4] = { 'D', 'X', 'V', 'K' };
uint32_t version = 13;
uint32_t version = 14;
uint32_t entrySize = 0; /* no longer meaningful */
};
@ -143,11 +143,35 @@ namespace dxvk {
VkBool32(m_depthClipEnable),
VkBool32(m_depthBiasEnable),
VkPolygonMode(m_polygonMode),
VkCullModeFlags(m_cullMode),
VkFrontFace(m_frontFace),
VkSampleCountFlags(m_sampleCount),
VkConservativeRasterizationModeEXT(m_conservativeMode));
}
};
class DxvkRsInfoV13 {
public:
uint16_t m_depthClipEnable : 1;
uint16_t m_depthBiasEnable : 1;
uint16_t m_polygonMode : 2;
uint16_t m_cullMode : 2;
uint16_t m_frontFace : 1;
uint16_t m_sampleCount : 5;
uint16_t m_conservativeMode : 2;
uint16_t m_reserved : 2;
DxvkRsInfo convert() const {
return DxvkRsInfo(
VkBool32(m_depthClipEnable),
VkBool32(m_depthBiasEnable),
VkPolygonMode(m_polygonMode),
VkSampleCountFlags(m_sampleCount),
VkConservativeRasterizationModeEXT(m_conservativeMode));
}
};
}