[GPU] Ownership-transfer-based RT cache, 3x3 resolution scaling

The ROV path is also disabled by default because of lower performance
This commit is contained in:
Triang3l
2021-04-26 22:12:09 +03:00
parent 30ea6e3ea3
commit 913e1e949c
362 changed files with 185259 additions and 38291 deletions

View File

@@ -74,7 +74,8 @@ class SharedMemory {
// Checks if the range has been updated, uploads new data if needed and
// ensures the host GPU memory backing the range are resident. Returns true if
// the range has been fully updated and is usable.
bool RequestRange(uint32_t start, uint32_t length);
bool RequestRange(uint32_t start, uint32_t length,
bool* any_data_resolved_out = nullptr);
// Marks the range and, if not exact_range, potentially its surroundings
// (to up to the first GPU-written page, as an access violation exception
@@ -90,7 +91,7 @@ class SharedMemory {
// be called, to make sure, if the GPU writes don't overwrite *everything* in
// the pages they touch, the CPU data is properly loaded to the unmodified
// regions in those pages.
void RangeWrittenByGpu(uint32_t start, uint32_t length);
void RangeWrittenByGpu(uint32_t start, uint32_t length, bool is_resolve);
protected:
SharedMemory(Memory& memory);
@@ -119,7 +120,8 @@ class SharedMemory {
uint32_t length_allocations);
// Mark the memory range as updated and protect it.
void MakeRangeValid(uint32_t start, uint32_t length, bool written_by_gpu);
void MakeRangeValid(uint32_t start, uint32_t length, bool written_by_gpu,
bool written_by_gpu_resolve);
// Uploads a range of host pages - only called if host GPU sparse memory
// allocation succeeded if needed. While uploading, MarkRangeValid must be
@@ -188,6 +190,9 @@ class SharedMemory {
// Subset of valid pages - whether each page in the GPU buffer contains data
// that was written on the GPU, thus should not be invalidated spuriously.
uint64_t valid_and_gpu_written;
// Subset of valid_and_gpu_written - whether each page in the GPU buffer
// contains data written specifically by resolving from EDRAM.
uint64_t valid_and_gpu_resolved;
};
// Flags for each 64 system pages, interleaved as blocks, so bit scan can be
// used to quickly extract ranges.