1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[dxvk] Allow creating buffer views with undefined format

This commit is contained in:
Philip Rebohle 2023-01-12 18:18:11 +01:00 committed by Philip Rebohle
parent 92de3f3f5f
commit c347bd4d8b

View File

@ -204,8 +204,9 @@ namespace dxvk {
const DxvkBufferViewCreateInfo& info)
: m_vkd(vkd), m_info(info), m_buffer(buffer),
m_bufferSlice (getSliceHandle()),
m_bufferView (createBufferView(m_bufferSlice)) {
m_bufferView (VK_NULL_HANDLE) {
if (m_info.format != VK_FORMAT_UNDEFINED)
m_bufferView = createBufferView(m_bufferSlice);
}
@ -247,17 +248,21 @@ namespace dxvk {
void DxvkBufferView::updateBufferView(
const DxvkBufferSliceHandle& slice) {
if (m_views.empty())
m_views.insert({ m_bufferSlice, m_bufferView });
if (m_info.format != VK_FORMAT_UNDEFINED) {
if (m_views.empty())
m_views.insert({ m_bufferSlice, m_bufferView });
m_bufferSlice = slice;
m_bufferSlice = slice;
auto entry = m_views.find(slice);
if (entry != m_views.end()) {
m_bufferView = entry->second;
auto entry = m_views.find(slice);
if (entry != m_views.end()) {
m_bufferView = entry->second;
} else {
m_bufferView = createBufferView(m_bufferSlice);
m_views.insert({ m_bufferSlice, m_bufferView });
}
} else {
m_bufferView = createBufferView(m_bufferSlice);
m_views.insert({ m_bufferSlice, m_bufferView });
m_bufferSlice = slice;
}
}