1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 23:52:20 +01:00

[dxvk] Use new lifetime tracking for raw allocations

This commit is contained in:
Philip Rebohle 2024-10-17 16:10:32 +02:00 committed by Philip Rebohle
parent b011e22406
commit 8389734e9f
5 changed files with 5 additions and 13 deletions

View File

@ -255,14 +255,6 @@ namespace dxvk {
* the device can guarantee that the submission has
* completed.
*/
void trackResource(Rc<DxvkResourceAllocation>&& rc) {
m_resources.trackResource(std::move(rc));
}
void trackResource(const Rc<DxvkResourceAllocation>& rc) {
m_resources.trackResource(Rc<DxvkResourceAllocation>(rc));
}
template<DxvkAccess Access, typename T>
void trackResource(Rc<T>&& rc) {
m_resources.trackResource(DxvkLifetime<DxvkResource>(std::move(rc), Access));

View File

@ -1381,7 +1381,7 @@ namespace dxvk {
const Rc<DxvkBuffer>& buffer,
Rc<DxvkResourceAllocation>&& slice) {
Rc<DxvkResourceAllocation> prevAllocation = buffer->assignStorage(std::move(slice));
m_cmd->trackResource(std::move(prevAllocation));
m_cmd->track(std::move(prevAllocation));
// We also need to update all bindings that the buffer
// may be bound to either directly or through views.
@ -1437,7 +1437,7 @@ namespace dxvk {
Rc<DxvkResourceAllocation>&& slice,
const DxvkImageUsageInfo& usageInfo) {
Rc<DxvkResourceAllocation> prevAllocation = image->assignStorageWithUsage(std::move(slice), usageInfo);
m_cmd->trackResource(std::move(prevAllocation));
m_cmd->track(std::move(prevAllocation));
VkImageUsageFlags usage = image->info().usage;

View File

@ -401,7 +401,7 @@ namespace dxvk {
DxvkSparseMapping&& mapping) {
if (m_mappings[page] != mapping) {
if (m_mappings[page])
cmd->trackResource(m_mappings[page].m_page);
cmd->track(m_mappings[page].m_page);
m_mappings[page] = std::move(mapping);
}

View File

@ -1208,7 +1208,7 @@ namespace dxvk::hud {
} else {
// Ensure we can update the buffer without overriding live data
auto allocation = m_dataBuffer->assignStorage(m_dataBuffer->allocateStorage());
ctx.cmd->trackResource(std::move(allocation));
ctx.cmd->track(std::move(allocation));
}
// Update draw infos and pad unused area with zeroes

View File

@ -156,7 +156,7 @@ namespace dxvk::hud {
} else {
// Discard and invalidate buffer so we can safely update it
auto storage = m_textBuffer->assignStorage(Rc<DxvkResourceAllocation>(m_textBuffer->allocateStorage()));
ctx.cmd->trackResource(std::move(storage));
ctx.cmd->track(std::move(storage));
}
// Upload aligned text data in such a way that we write full cache lines