mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-30 04:24:11 +01:00
[dxvk] Add method to explicitly release staging buffer memory
This commit is contained in:
parent
1c9bc235d0
commit
34cdba1df5
@ -2284,6 +2284,11 @@ namespace dxvk {
|
||||
void DxvkContext::writeTimestamp(const Rc<DxvkGpuQuery>& query) {
|
||||
m_queryManager.writeTimestamp(m_cmd, query);
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::trimStagingBuffers() {
|
||||
m_staging.trim();
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::clearImageViewFb(
|
||||
|
@ -954,6 +954,15 @@ namespace dxvk {
|
||||
void writeTimestamp(
|
||||
const Rc<DxvkGpuQuery>& query);
|
||||
|
||||
/**
|
||||
* \brief Trims staging buffers
|
||||
*
|
||||
* Releases staging buffer resources. Calling
|
||||
* this may be useful if data updates on a
|
||||
* given context are rare.
|
||||
*/
|
||||
void trimStagingBuffers();
|
||||
|
||||
private:
|
||||
|
||||
const Rc<DxvkDevice> m_device;
|
||||
|
@ -46,6 +46,15 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkStagingDataAlloc::trim() {
|
||||
m_buffer = nullptr;
|
||||
m_offset = 0;
|
||||
|
||||
while (!m_buffers.empty())
|
||||
m_buffers.pop();
|
||||
}
|
||||
|
||||
|
||||
Rc<DxvkBuffer> DxvkStagingDataAlloc::createBuffer(VkDeviceSize size) {
|
||||
DxvkBufferCreateInfo info;
|
||||
info.size = size;
|
||||
|
@ -33,6 +33,14 @@ namespace dxvk {
|
||||
*/
|
||||
DxvkBufferSlice alloc(VkDeviceSize align, VkDeviceSize size);
|
||||
|
||||
/**
|
||||
* \brief Deletes all staging buffers
|
||||
*
|
||||
* Destroys allocated buffers and
|
||||
* releases all buffer memory.
|
||||
*/
|
||||
void trim();
|
||||
|
||||
private:
|
||||
|
||||
Rc<DxvkDevice> m_device;
|
||||
|
Loading…
Reference in New Issue
Block a user