1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[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.
This commit is contained in:
Philip Rebohle 2018-11-09 11:40:44 +01:00
parent bd03225c14
commit 504de3994b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 6 additions and 9 deletions

View File

@ -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<DxvkPhysicalBufferView> DxvkBufferView::createView() { Rc<DxvkPhysicalBufferView> DxvkBufferView::createView() {
return new DxvkPhysicalBufferView( return new DxvkPhysicalBufferView(
m_vkd, m_buffer->slice(), m_info); m_vkd, m_buffer->slice(), m_info);

View File

@ -467,7 +467,12 @@ namespace dxvk {
* well and needs to be re-created. Call this * well and needs to be re-created. Call this
* prior to using the buffer view handle. * 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: private: