1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 07:24:15 +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 DxvkBufferViewCreateInfo& info)
: m_vkd(vkd), m_info(info), m_buffer(buffer),
m_bufferSlice (m_buffer->getSliceHandle()),
m_bufferSlice (getSliceHandle()),
m_bufferView (createBufferView(m_bufferSlice)) {
}
@ -188,13 +188,14 @@ namespace dxvk {
}
void DxvkBufferView::updateBufferView() {
void DxvkBufferView::updateBufferView(
const DxvkBufferSliceHandle& slice) {
if (m_views.empty())
m_views.insert({ m_bufferSlice, m_bufferView });
m_bufferSlice = m_buffer->getSliceHandle();
auto entry = m_views.find(m_bufferSlice);
m_bufferSlice = slice;
auto entry = m_views.find(slice);
if (entry != m_views.end()) {
m_bufferView = entry->second;
} else {

View File

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