1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 16:24:29 +01:00

[dxvk] Fix incorrect buffer view range for views with non-zero offset

This commit is contained in:
Philip Rebohle 2019-01-18 21:26:48 +01:00
parent 7e975bbdfc
commit 9dbe352c51
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 12 additions and 8 deletions

View File

@ -143,7 +143,7 @@ namespace dxvk {
const Rc<DxvkBuffer>& buffer, const Rc<DxvkBuffer>& buffer,
const DxvkBufferViewCreateInfo& info) const DxvkBufferViewCreateInfo& info)
: m_vkd(vkd), m_info(info), m_buffer(buffer), : m_vkd(vkd), m_info(info), m_buffer(buffer),
m_bufferSlice (m_buffer->getSliceHandle()), m_bufferSlice (getSliceHandle()),
m_bufferView (createBufferView(m_bufferSlice)) { m_bufferView (createBufferView(m_bufferSlice)) {
} }
@ -188,13 +188,14 @@ namespace dxvk {
} }
void DxvkBufferView::updateBufferView() { void DxvkBufferView::updateBufferView(
const DxvkBufferSliceHandle& slice) {
if (m_views.empty()) if (m_views.empty())
m_views.insert({ m_bufferSlice, m_bufferView }); m_views.insert({ m_bufferSlice, m_bufferView });
m_bufferSlice = m_buffer->getSliceHandle(); m_bufferSlice = slice;
auto entry = m_views.find(m_bufferSlice);
auto entry = m_views.find(slice);
if (entry != m_views.end()) { if (entry != m_views.end()) {
m_bufferView = entry->second; m_bufferView = entry->second;
} else { } else {

View File

@ -515,8 +515,10 @@ namespace dxvk {
* prior to using the buffer view handle. * prior to using the buffer view handle.
*/ */
void updateView() { void updateView() {
if (!m_bufferSlice.eq(m_buffer->getSliceHandle())) DxvkBufferSliceHandle slice = getSliceHandle();
this->updateBufferView();
if (!m_bufferSlice.eq(slice))
this->updateBufferView(slice);
} }
private: private:
@ -536,7 +538,8 @@ namespace dxvk {
VkBufferView createBufferView( VkBufferView createBufferView(
const DxvkBufferSliceHandle& slice); const DxvkBufferSliceHandle& slice);
void updateBufferView(); void updateBufferView(
const DxvkBufferSliceHandle& slice);
}; };