summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/gpu.cpp6
-rw-r--r--src/video_core/gpu.h9
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
-rw-r--r--src/yuzu/debugger/graphics/graphics_surface.cpp6
4 files changed, 17 insertions, 14 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index e36483145..a003bc9e3 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -20,7 +20,11 @@ GPU::GPU() {
20 20
21GPU::~GPU() = default; 21GPU::~GPU() = default;
22 22
23const Tegra::Engines::Maxwell3D& GPU::Get3DEngine() const { 23const Engines::Maxwell3D& GPU::Maxwell3D() const {
24 return *maxwell_3d;
25}
26
27Engines::Maxwell3D& GPU::Maxwell3D() {
24 return *maxwell_3d; 28 return *maxwell_3d;
25} 29}
26 30
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 60930e997..a32148ecd 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -93,15 +93,14 @@ public:
93 /// Processes a command list stored at the specified address in GPU memory. 93 /// Processes a command list stored at the specified address in GPU memory.
94 void ProcessCommandList(GPUVAddr address, u32 size); 94 void ProcessCommandList(GPUVAddr address, u32 size);
95 95
96 /// Returns a const reference to the Maxwell3D GPU engine.
97 const Engines::Maxwell3D& Maxwell3D() const;
98
96 /// Returns a reference to the Maxwell3D GPU engine. 99 /// Returns a reference to the Maxwell3D GPU engine.
97 const Engines::Maxwell3D& Get3DEngine() const; 100 Engines::Maxwell3D& Maxwell3D();
98 101
99 std::unique_ptr<MemoryManager> memory_manager; 102 std::unique_ptr<MemoryManager> memory_manager;
100 103
101 Engines::Maxwell3D& Maxwell3D() {
102 return *maxwell_3d;
103 }
104
105private: 104private:
106 /// Writes a single register in the engine bound to the specified subchannel 105 /// Writes a single register in the engine bound to the specified subchannel
107 void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params); 106 void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index f75999557..65a2fd5e8 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -634,8 +634,8 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(const Tegra::Texture::TSCEntr
634u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint program, 634u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint program,
635 u32 current_bindpoint, 635 u32 current_bindpoint,
636 const std::vector<GLShader::ConstBufferEntry>& entries) { 636 const std::vector<GLShader::ConstBufferEntry>& entries) {
637 auto& gpu = Core::System::GetInstance().GPU(); 637 const auto& gpu = Core::System::GetInstance().GPU();
638 auto& maxwell3d = gpu.Get3DEngine(); 638 const auto& maxwell3d = gpu.Maxwell3D();
639 639
640 // Reset all buffer draw state for this stage. 640 // Reset all buffer draw state for this stage.
641 for (auto& buffer : state.draw.const_buffers[static_cast<size_t>(stage)]) { 641 for (auto& buffer : state.draw.const_buffers[static_cast<size_t>(stage)]) {
@@ -644,7 +644,7 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
644 } 644 }
645 645
646 // Upload only the enabled buffers from the 16 constbuffers of each shader stage 646 // Upload only the enabled buffers from the 16 constbuffers of each shader stage
647 auto& shader_stage = maxwell3d.state.shader_stages[static_cast<size_t>(stage)]; 647 const auto& shader_stage = maxwell3d.state.shader_stages[static_cast<size_t>(stage)];
648 648
649 for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { 649 for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) {
650 const auto& used_buffer = entries[bindpoint]; 650 const auto& used_buffer = entries[bindpoint];
@@ -700,8 +700,8 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
700 700
701u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, u32 current_unit, 701u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, u32 current_unit,
702 const std::vector<GLShader::SamplerEntry>& entries) { 702 const std::vector<GLShader::SamplerEntry>& entries) {
703 auto& gpu = Core::System::GetInstance().GPU(); 703 const auto& gpu = Core::System::GetInstance().GPU();
704 auto& maxwell3d = gpu.Get3DEngine(); 704 const auto& maxwell3d = gpu.Maxwell3D();
705 705
706 ASSERT_MSG(current_unit + entries.size() <= std::size(state.texture_units), 706 ASSERT_MSG(current_unit + entries.size() <= std::size(state.texture_units),
707 "Exceeded the number of active textures."); 707 "Exceeded the number of active textures.");
diff --git a/src/yuzu/debugger/graphics/graphics_surface.cpp b/src/yuzu/debugger/graphics/graphics_surface.cpp
index 1fbca8ad0..c41ff693b 100644
--- a/src/yuzu/debugger/graphics/graphics_surface.cpp
+++ b/src/yuzu/debugger/graphics/graphics_surface.cpp
@@ -336,9 +336,9 @@ void GraphicsSurfaceWidget::OnUpdate() {
336 // TODO: Store a reference to the registers in the debug context instead of accessing them 336 // TODO: Store a reference to the registers in the debug context instead of accessing them
337 // directly... 337 // directly...
338 338
339 auto& registers = gpu.Get3DEngine().regs; 339 const auto& registers = gpu.Maxwell3D().regs;
340 auto& rt = registers.rt[static_cast<size_t>(surface_source) - 340 const auto& rt = registers.rt[static_cast<size_t>(surface_source) -
341 static_cast<size_t>(Source::RenderTarget0)]; 341 static_cast<size_t>(Source::RenderTarget0)];
342 342
343 surface_address = rt.Address(); 343 surface_address = rt.Address();
344 surface_width = rt.width; 344 surface_width = rt.width;