From 504de3994b35b3884274eec6c201d1ee1fe91c5c Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 9 Nov 2018 11:40:44 +0100 Subject: [PATCH] [dxvk] Inline DxvkBufferView::updateView method Most of the time the condition is false, so we should help the compiler where we can to optimize for the common case. --- src/dxvk/dxvk_buffer.cpp | 8 -------- src/dxvk/dxvk_buffer.h | 7 ++++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/dxvk/dxvk_buffer.cpp b/src/dxvk/dxvk_buffer.cpp index fc9f3a902..c316b0688 100644 --- a/src/dxvk/dxvk_buffer.cpp +++ b/src/dxvk/dxvk_buffer.cpp @@ -92,14 +92,6 @@ namespace dxvk { } - void DxvkBufferView::updateView() { - if (m_revision != m_buffer->m_revision) { - m_physView = this->createView(); - m_revision = m_buffer->m_revision; - } - } - - Rc DxvkBufferView::createView() { return new DxvkPhysicalBufferView( m_vkd, m_buffer->slice(), m_info); diff --git a/src/dxvk/dxvk_buffer.h b/src/dxvk/dxvk_buffer.h index 778871788..c57e81eae 100644 --- a/src/dxvk/dxvk_buffer.h +++ b/src/dxvk/dxvk_buffer.h @@ -467,7 +467,12 @@ namespace dxvk { * well and needs to be re-created. Call this * prior to using the buffer view handle. */ - void updateView(); + void updateView() { + if (m_revision != m_buffer->m_revision) { + m_physView = this->createView(); + m_revision = m_buffer->m_revision; + } + } private: