From 12efd8872693a6db0d41dcf704bd9a86589204bf Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 17 Sep 2018 23:42:34 +0200 Subject: [PATCH] [dxvk] Avoid more unnecessary copies of ref-counted pointers Improves performance measurably in Shadow Warrior 2 when CPU bound. --- src/dxvk/dxvk_buffer.h | 4 ++-- src/dxvk/dxvk_image.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dxvk/dxvk_buffer.h b/src/dxvk/dxvk_buffer.h index 4daaa9a2..ea4e3e1f 100644 --- a/src/dxvk/dxvk_buffer.h +++ b/src/dxvk/dxvk_buffer.h @@ -196,7 +196,7 @@ namespace dxvk { * \brief Underlying buffer * \returns The virtual buffer */ - Rc buffer() const { + const Rc& buffer() const { return m_buffer; } @@ -332,7 +332,7 @@ namespace dxvk { * \brief Underlying buffer object * \returns Underlying buffer object */ - Rc buffer() const { + const Rc& buffer() const { return m_buffer; } diff --git a/src/dxvk/dxvk_image.h b/src/dxvk/dxvk_image.h index f7054c22..7398e694 100644 --- a/src/dxvk/dxvk_image.h +++ b/src/dxvk/dxvk_image.h @@ -339,7 +339,7 @@ namespace dxvk { * \brief Image object * \returns Image object */ - Rc image() const { + const Rc& image() const { return m_image; }