summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-02-16 16:24:37 -0400
committerGravatar Fernando Sahmkow2020-04-22 11:36:08 -0400
commit339d0d9d6c02cf79d6025dae7c60d8635fa4ea3b (patch)
treec9a583f3a581fd52cef4d77c2c82d4d9a1e9c1fe /src/video_core/engines
parentBufferCache: Implement OnCPUWrite and SyncGuestHost (diff)
downloadyuzu-339d0d9d6c02cf79d6025dae7c60d8635fa4ea3b.tar.gz
yuzu-339d0d9d6c02cf79d6025dae7c60d8635fa4ea3b.tar.xz
yuzu-339d0d9d6c02cf79d6025dae7c60d8635fa4ea3b.zip
GPU: Delay Fences.
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp10
-rw-r--r--src/video_core/engines/maxwell_3d.h4
2 files changed, 13 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 2298a6273..2605c3b42 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -397,6 +397,14 @@ void Maxwell3D::StampQueryResult(u64 payload, bool long_query) {
397 } 397 }
398} 398}
399 399
400void Maxwell3D::ReleaseFences() {
401 for (const auto pair : delay_fences) {
402 const auto [addr, payload] = pair;
403 memory_manager.Write<u32>(addr, static_cast<u32>(payload));
404 }
405 delay_fences.clear();
406}
407
400void Maxwell3D::ProcessQueryGet() { 408void Maxwell3D::ProcessQueryGet() {
401 // TODO(Subv): Support the other query units. 409 // TODO(Subv): Support the other query units.
402 ASSERT_MSG(regs.query.query_get.unit == Regs::QueryUnit::Crop, 410 ASSERT_MSG(regs.query.query_get.unit == Regs::QueryUnit::Crop,
@@ -407,7 +415,7 @@ void Maxwell3D::ProcessQueryGet() {
407 rasterizer.FlushCommands(); 415 rasterizer.FlushCommands();
408 rasterizer.SyncGuestHost(); 416 rasterizer.SyncGuestHost();
409 const u64 result = regs.query.query_sequence; 417 const u64 result = regs.query.query_sequence;
410 StampQueryResult(result, regs.query.query_get.short_query == 0); 418 delay_fences.emplace_back(regs.query.QueryAddress(), result);
411 break; 419 break;
412 } 420 }
413 case Regs::QueryOperation::Acquire: 421 case Regs::QueryOperation::Acquire:
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 59d5752d2..0a93827ec 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1427,6 +1427,8 @@ public:
1427 Tables tables{}; 1427 Tables tables{};
1428 } dirty; 1428 } dirty;
1429 1429
1430 void ReleaseFences();
1431
1430private: 1432private:
1431 void InitializeRegisterDefaults(); 1433 void InitializeRegisterDefaults();
1432 1434
@@ -1467,6 +1469,8 @@ private:
1467 1469
1468 std::array<u8, Regs::NUM_REGS> dirty_pointers{}; 1470 std::array<u8, Regs::NUM_REGS> dirty_pointers{};
1469 1471
1472 std::vector<std::pair<GPUVAddr, u64>> delay_fences;
1473
1470 /// Retrieves information about a specific TIC entry from the TIC buffer. 1474 /// Retrieves information about a specific TIC entry from the TIC buffer.
1471 Texture::TICEntry GetTICEntry(u32 tic_index) const; 1475 Texture::TICEntry GetTICEntry(u32 tic_index) const;
1472 1476