summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-10-21 01:46:51 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-01-01 22:43:57 +0100
commit93ac5a6a6d316966c1d288f8b83610bb48143a04 (patch)
treede24cc21ecb8b49d60d63356f18de6324be4cb38 /src/video_core/engines
parentMacroHLE: Refactor MacroHLE system. (diff)
downloadyuzu-93ac5a6a6d316966c1d288f8b83610bb48143a04.tar
yuzu-93ac5a6a6d316966c1d288f8b83610bb48143a04.tar.gz
yuzu-93ac5a6a6d316966c1d288f8b83610bb48143a04.tar.bz2
yuzu-93ac5a6a6d316966c1d288f8b83610bb48143a04.tar.lz
yuzu-93ac5a6a6d316966c1d288f8b83610bb48143a04.tar.xz
yuzu-93ac5a6a6d316966c1d288f8b83610bb48143a04.tar.zst
yuzu-93ac5a6a6d316966c1d288f8b83610bb48143a04.zip
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp7
-rw-r--r--src/video_core/engines/maxwell_3d.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index b998a8e69..a0dd7400d 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -179,6 +179,13 @@ u32 Maxwell3D::GetMaxCurrentVertices() {
return num_vertices;
}
+size_t Maxwell3D::EstimateIndexBufferSize() {
+ GPUVAddr start_address = regs.index_buffer.StartAddress();
+ GPUVAddr end_address = regs.index_buffer.EndAddress();
+ return std::min<size_t>(memory_manager.GetMemoryLayoutSize(start_address),
+ static_cast<size_t>(end_address - start_address));
+}
+
u32 Maxwell3D::ProcessShadowRam(u32 method, u32 argument) {
// Keep track of the register value in shadow_state when requested.
const auto control = shadow_state.shadow_ram_control;
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index e2256594d..cfe1e4883 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -3077,6 +3077,8 @@ public:
u32 GetMaxCurrentVertices();
+ size_t EstimateIndexBufferSize();
+
/// Handles a write to the CLEAR_BUFFERS register.
void ProcessClearBuffers(u32 layer_count);