summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2016-12-28 01:37:41 +0100
committerdegasus <wickmarkus@web.de>2017-01-04 20:02:31 +0100
commit41b0c74e3056ec0d0b354896684debb2d82320f3 (patch)
treefb2b3f0b624a4dc275100633e6a251fa1944e5e6 /Source/Core/VideoBackends/Vulkan/StateTracker.cpp
parentb7d8bd13a6c44eecf5c5e59ea60796e3018785f9 (diff)
VideoCommon: Make dst_alpha state implicit.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/StateTracker.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/StateTracker.cpp42
1 files changed, 3 insertions, 39 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/StateTracker.cpp b/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
index d374ec5f1d..69830f11d9 100644
--- a/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
+++ b/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
@@ -304,10 +304,10 @@ void StateTracker::SetBlendState(const BlendState& state)
m_dirty_flags |= DIRTY_FLAG_PIPELINE;
}
-bool StateTracker::CheckForShaderChanges(u32 gx_primitive_type, DSTALPHA_MODE dstalpha_mode)
+bool StateTracker::CheckForShaderChanges(u32 gx_primitive_type)
{
VertexShaderUid vs_uid = GetVertexShaderUid();
- PixelShaderUid ps_uid = GetPixelShaderUid(dstalpha_mode);
+ PixelShaderUid ps_uid = GetPixelShaderUid();
bool changed = false;
@@ -340,16 +340,6 @@ bool StateTracker::CheckForShaderChanges(u32 gx_primitive_type, DSTALPHA_MODE ds
changed = true;
}
- if (m_dstalpha_mode != dstalpha_mode)
- {
- // Switching to/from alpha pass requires a pipeline change, since the blend state
- // is overridden in the destination alpha pass.
- if (m_dstalpha_mode == DSTALPHA_ALPHA_PASS || dstalpha_mode == DSTALPHA_ALPHA_PASS)
- changed = true;
-
- m_dstalpha_mode = dstalpha_mode;
- }
-
if (changed)
m_dirty_flags |= DIRTY_FLAG_PIPELINE;
@@ -881,22 +871,6 @@ void StateTracker::EndClearRenderPass()
EndRenderPass();
}
-PipelineInfo StateTracker::GetAlphaPassPipelineConfig(const PipelineInfo& info) const
-{
- PipelineInfo temp_info = info;
-
- // Skip depth writes for this pass. The results will be the same, so no
- // point in overwriting depth values with the same value.
- temp_info.depth_stencil_state.write_enable = VK_FALSE;
-
- // Only allow alpha writes, and disable blending.
- temp_info.blend_state.blend_enable = VK_FALSE;
- temp_info.blend_state.logic_op_enable = VK_FALSE;
- temp_info.blend_state.write_mask = VK_COLOR_COMPONENT_A_BIT;
-
- return temp_info;
-}
-
VkPipeline StateTracker::GetPipelineAndCacheUID(const PipelineInfo& info)
{
auto result = g_object_cache->GetPipelineWithCacheResult(info);
@@ -915,17 +889,7 @@ bool StateTracker::UpdatePipeline()
return false;
// Grab a new pipeline object, this can fail.
- // We have to use a different blend state for the alpha pass of the dstalpha fallback.
- if (m_dstalpha_mode == DSTALPHA_ALPHA_PASS)
- {
- // We need to retain the existing state, since we don't want to break the next draw.
- PipelineInfo temp_info = GetAlphaPassPipelineConfig(m_pipeline_state);
- m_pipeline_object = GetPipelineAndCacheUID(temp_info);
- }
- else
- {
- m_pipeline_object = GetPipelineAndCacheUID(m_pipeline_state);
- }
+ m_pipeline_object = GetPipelineAndCacheUID(m_pipeline_state);
m_dirty_flags |= DIRTY_FLAG_PIPELINE_BINDING;
return m_pipeline_object != VK_NULL_HANDLE;