mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
vk: Fix a rare GPU timeline UAF when replacing buffer views
- Might fix DEVICE_LOST errors observed on NV cards
This commit is contained in:
parent
417cefa059
commit
ebcf403f4a
2 changed files with 3 additions and 0 deletions
|
@ -2195,6 +2195,7 @@ void VKGSRender::update_vertex_env(u32 id, const vk::vertex_upload_info& vertex_
|
|||
|
||||
const usz alloc_addr = m_vertex_layout_stream_info.offset;
|
||||
const usz view_size = (alloc_addr + m_texbuffer_view_size) > m_vertex_layout_ring_info.size() ? m_vertex_layout_ring_info.size() - alloc_addr : m_texbuffer_view_size;
|
||||
vk::get_resource_manager()->dispose(m_vertex_layout_storage);
|
||||
m_vertex_layout_storage = std::make_unique<vk::buffer_view>(*m_device, m_vertex_layout_ring_info.heap->value, VK_FORMAT_R32G32_UINT, alloc_addr, view_size);
|
||||
base_offset = 0;
|
||||
}
|
||||
|
|
|
@ -345,6 +345,7 @@ vk::vertex_upload_info VKGSRender::upload_vertex_data()
|
|||
|
||||
//View 64M blocks at a time (different drivers will only allow a fixed viewable heap size, 64M should be safe)
|
||||
const usz view_size = (persistent_range_base + m_texbuffer_view_size) > m_attrib_ring_info.size() ? m_attrib_ring_info.size() - persistent_range_base : m_texbuffer_view_size;
|
||||
vk::get_resource_manager()->dispose(m_persistent_attribute_storage);
|
||||
m_persistent_attribute_storage = std::make_unique<vk::buffer_view>(*m_device, m_attrib_ring_info.heap->value, VK_FORMAT_R8_UINT, persistent_range_base, view_size);
|
||||
persistent_range_base = 0;
|
||||
}
|
||||
|
@ -362,6 +363,7 @@ vk::vertex_upload_info VKGSRender::upload_vertex_data()
|
|||
}
|
||||
|
||||
const usz view_size = (volatile_range_base + m_texbuffer_view_size) > m_attrib_ring_info.size() ? m_attrib_ring_info.size() - volatile_range_base : m_texbuffer_view_size;
|
||||
vk::get_resource_manager()->dispose(m_volatile_attribute_storage);
|
||||
m_volatile_attribute_storage = std::make_unique<vk::buffer_view>(*m_device, m_attrib_ring_info.heap->value, VK_FORMAT_R8_UINT, volatile_range_base, view_size);
|
||||
volatile_range_base = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue