Reorganize raster state mapping

This commit is contained in:
Henrik Rydgård committed 2017-04-03 16:37:11 +02:00
1 parent cffb1d7014
commit 73d762f506
4 files changed
+53 -39

No files matched your search

+10 -5
View File
@@ -221,10 +221,18 @@ void DrawEngineVulkan::ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManag
}
{
// Set Stencil/Depth
if (gstate.isModeClear()) {
key.cullMode = VK_CULL_MODE_NONE;
} else {
// Set cull
bool wantCull = !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES && gstate.isCullEnabled();
key.cullMode = wantCull ? (gstate.getCullMode() ? VK_CULL_MODE_FRONT_BIT : VK_CULL_MODE_BACK_BIT) : VK_CULL_MODE_NONE;
}
}
{
// Set Stencil/Depth
if (gstate.isModeClear()) {
key.depthTestEnable = true;
key.depthCompareOp = VK_COMPARE_OP_ALWAYS;
key.depthWriteEnable = gstate.isClearModeDepthMask();
@@ -261,10 +269,6 @@ void DrawEngineVulkan::ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManag
}
}
// Set cull
bool wantCull = !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES && gstate.isCullEnabled();
key.cullMode = wantCull ? (gstate.getCullMode() ? VK_CULL_MODE_FRONT_BIT : VK_CULL_MODE_BACK_BIT) : VK_CULL_MODE_NONE;
// Depth Test
if (gstate.isDepthTestEnabled()) {
key.depthTestEnable = true;
@@ -333,5 +337,6 @@ void DrawEngineVulkan::ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManag
gstate_c.Dirty(DIRTY_DEPTHRANGE);
}
}
key.topology = primToVulkan[prim];
}