mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 13:08:50 +01:00
[dxvk] Fix incorrect buffer view range for views with non-zero offset
This commit is contained in:
parent
7e975bbdfc
commit
9dbe352c51
@ -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 {
|
||||
|
@ -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);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user