From 818704d4135d63f84a7f5beb436e6a6ec21b7906 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 2 Jun 2019 20:29:22 +0200 Subject: [PATCH] [d3d11] Add some likely/unlikely around CS flushes --- src/d3d11/d3d11_context.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d3d11/d3d11_context.h b/src/d3d11/d3d11_context.h index b7e2a50db..08f927a88 100644 --- a/src/d3d11/d3d11_context.h +++ b/src/d3d11/d3d11_context.h @@ -829,7 +829,7 @@ namespace dxvk { void EmitCs(Cmd&& command) { m_cmdData = nullptr; - if (!m_csChunk->push(command)) { + if (unlikely(!m_csChunk->push(command))) { EmitCsChunk(std::move(m_csChunk)); m_csChunk = AllocCsChunk(); @@ -842,7 +842,7 @@ namespace dxvk { M* data = m_csChunk->pushCmd( command, std::forward(args)...); - if (!data) { + if (unlikely(!data)) { EmitCsChunk(std::move(m_csChunk)); m_csChunk = AllocCsChunk(); @@ -855,7 +855,7 @@ namespace dxvk { } void FlushCsChunk() { - if (m_csChunk->commandCount() != 0) { + if (likely(m_csChunk->commandCount())) { EmitCsChunk(std::move(m_csChunk)); m_csChunk = AllocCsChunk(); m_cmdData = nullptr;