[D3D12] SHM functions needed for resolves

This commit is contained in:
Triang3l
2018-08-18 22:43:02 +03:00
parent 36cc19017a
commit e3a50a207d
2 changed files with 109 additions and 44 deletions

View File

@@ -67,6 +67,10 @@ class SharedMemory {
inline void LockWatchMutex() { validity_mutex_.lock(); }
inline void UnlockWatchMutex() { validity_mutex_.unlock(); }
// Ensures the buffer tiles backing the range are resident, but doesn't upload
// anything.
bool MakeTilesResident(uint32_t start, uint32_t length);
// Checks if the range has been updated, uploads new data if needed and
// ensures the buffer tiles backing the range are resident. May transition the
// tiled buffer to copy destination - call this before UseForReading or
@@ -75,6 +79,12 @@ class SharedMemory {
bool RequestRange(uint32_t start, uint32_t length,
ID3D12GraphicsCommandList* command_list);
// Marks the range as containing GPU-generated data (such as resolves),
// triggering modification callbacks, making it valid (so pages are not
// copied from the main memory until they're modified by the CPU) and
// protecting it.
void RangeWrittenByGPU(uint32_t start, uint32_t length);
// Makes the buffer usable for vertices, indices and texture untiling.
void UseForReading(ID3D12GraphicsCommandList* command_list);
// Makes the buffer usable for texture tiling after a resolve.