summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/VertexManager.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-01-04 20:05:26 +0100
committerGitHub <noreply@github.com>2017-01-04 20:05:26 +0100
commit389f8297c3bb1829cf7c62f5461457f4d4c501bc (patch)
treefb2b3f0b624a4dc275100633e6a251fa1944e5e6 /Source/Core/VideoBackends/Vulkan/VertexManager.cpp
parentf46f779f70d70d6cdd3de63286ca0da69be9aa00 (diff)
parent41b0c74e3056ec0d0b354896684debb2d82320f3 (diff)
Merge pull request #4577 from degasus/videocommon
OGL/Vulkan: Drop destination alpha pass.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/VertexManager.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/VertexManager.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VertexManager.cpp b/Source/Core/VideoBackends/Vulkan/VertexManager.cpp
index f3116a8cb6..53309b3aec 100644
--- a/Source/Core/VideoBackends/Vulkan/VertexManager.cpp
+++ b/Source/Core/VideoBackends/Vulkan/VertexManager.cpp
@@ -124,7 +124,7 @@ void VertexManager::ResetBuffer(u32 stride)
static_cast<u32>(m_index_stream_buffer->GetCurrentOffset() / sizeof(u16));
}
-void VertexManager::vFlush(bool use_dst_alpha)
+void VertexManager::vFlush()
{
const VertexFormat* vertex_format =
static_cast<VertexFormat*>(VertexLoaderManager::GetCurrentVertexFormat());
@@ -153,13 +153,8 @@ void VertexManager::vFlush(bool use_dst_alpha)
break;
}
- // Can we do single-pass dst alpha?
- DSTALPHA_MODE dstalpha_mode = DSTALPHA_NONE;
- if (use_dst_alpha && g_vulkan_context->SupportsDualSourceBlend())
- dstalpha_mode = DSTALPHA_DUAL_SOURCE_BLEND;
-
// Check for any shader stage changes
- StateTracker::GetInstance()->CheckForShaderChanges(m_current_primitive_type, dstalpha_mode);
+ StateTracker::GetInstance()->CheckForShaderChanges(m_current_primitive_type);
// Update any changed constants
StateTracker::GetInstance()->UpdateVertexShaderConstants();
@@ -202,27 +197,6 @@ void VertexManager::vFlush(bool use_dst_alpha)
vkCmdDrawIndexed(g_command_buffer_mgr->GetCurrentCommandBuffer(), index_count, 1,
m_current_draw_base_index, m_current_draw_base_vertex, 0);
- // If the GPU does not support dual-source blending, we can approximate the effect by drawing
- // the object a second time, with the write mask set to alpha only using a shader that outputs
- // the destination/constant alpha value (which would normally be SRC_COLOR.a).
- //
- // This is also used when logic ops and destination alpha is enabled, since we can't enable
- // blending and logic ops concurrently (and the logical operation applies to all channels).
- bool logic_op_enabled = bpmem.blendmode.logicopenable && !bpmem.blendmode.blendenable;
- if (use_dst_alpha && (!g_vulkan_context->SupportsDualSourceBlend() || logic_op_enabled))
- {
- StateTracker::GetInstance()->CheckForShaderChanges(m_current_primitive_type,
- DSTALPHA_ALPHA_PASS);
- if (!StateTracker::GetInstance()->Bind())
- {
- WARN_LOG(VIDEO, "Skipped draw of %u indices (alpha pass)", index_count);
- return;
- }
-
- vkCmdDrawIndexed(g_command_buffer_mgr->GetCurrentCommandBuffer(), index_count, 1,
- m_current_draw_base_index, m_current_draw_base_vertex, 0);
- }
-
StateTracker::GetInstance()->OnDraw();
}