summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2020-06-05 13:09:52 +1000
committerGravatar David Marcec2020-06-24 12:09:03 +1000
commitfabdf5d3850c078d173653f259845c26a2ce6e7d (patch)
tree151a9eeefd518722f45cbe6446f1928ebf26bddb /src
parentFix constbuffer for 0217920100488FF7 (diff)
downloadyuzu-fabdf5d3850c078d173653f259845c26a2ce6e7d.tar.gz
yuzu-fabdf5d3850c078d173653f259845c26a2ce6e7d.tar.xz
yuzu-fabdf5d3850c078d173653f259845c26a2ce6e7d.zip
Addressed issues
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_3d.h4
-rw-r--r--src/video_core/macro/macro.cpp2
-rw-r--r--src/video_core/macro/macro.h2
-rw-r--r--src/video_core/macro/macro_hle.cpp20
-rw-r--r--src/video_core/macro/macro_hle.h2
5 files changed, 17 insertions, 13 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 5926c4d2d..ef1618990 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1422,6 +1422,10 @@ public:
1422 return rasterizer; 1422 return rasterizer;
1423 } 1423 }
1424 1424
1425 const VideoCore::RasterizerInterface& GetRasterizer() const {
1426 return rasterizer;
1427 }
1428
1425 /// Notify a memory write has happened. 1429 /// Notify a memory write has happened.
1426 void OnMemoryWrite() { 1430 void OnMemoryWrite() {
1427 dirty.flags |= dirty.on_write_stores; 1431 dirty.flags |= dirty.on_write_stores;
diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp
index c8aa2534a..ef7dad349 100644
--- a/src/video_core/macro/macro.cpp
+++ b/src/video_core/macro/macro.cpp
@@ -17,7 +17,7 @@ namespace Tegra {
17MacroEngine::MacroEngine(Engines::Maxwell3D& maxwell3d) 17MacroEngine::MacroEngine(Engines::Maxwell3D& maxwell3d)
18 : hle_macros{std::make_unique<Tegra::HLEMacro>(maxwell3d)} {} 18 : hle_macros{std::make_unique<Tegra::HLEMacro>(maxwell3d)} {}
19 19
20MacroEngine::~MacroEngine() {} 20MacroEngine::~MacroEngine() = default;
21 21
22void MacroEngine::AddCode(u32 method, u32 data) { 22void MacroEngine::AddCode(u32 method, u32 data) {
23 uploaded_macro_code[method].push_back(data); 23 uploaded_macro_code[method].push_back(data);
diff --git a/src/video_core/macro/macro.h b/src/video_core/macro/macro.h
index 5fa8023af..4d00b84b0 100644
--- a/src/video_core/macro/macro.h
+++ b/src/video_core/macro/macro.h
@@ -111,7 +111,7 @@ public:
111 111
112class MacroEngine { 112class MacroEngine {
113public: 113public:
114 MacroEngine(Engines::Maxwell3D& maxwell3d); 114 explicit MacroEngine(Engines::Maxwell3D& maxwell3d);
115 virtual ~MacroEngine(); 115 virtual ~MacroEngine();
116 116
117 // Store the uploaded macro code to compile them when they're called. 117 // Store the uploaded macro code to compile them when they're called.
diff --git a/src/video_core/macro/macro_hle.cpp b/src/video_core/macro/macro_hle.cpp
index 887f40310..1f1348df3 100644
--- a/src/video_core/macro/macro_hle.cpp
+++ b/src/video_core/macro/macro_hle.cpp
@@ -2,7 +2,7 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <unordered_map> 5#include <array>
6#include <vector> 6#include <vector>
7#include "video_core/engines/maxwell_3d.h" 7#include "video_core/engines/maxwell_3d.h"
8#include "video_core/macro/macro_hle.h" 8#include "video_core/macro/macro_hle.h"
@@ -78,22 +78,22 @@ static void HLE_0217920100488FF7(Engines::Maxwell3D& maxwell3d,
78 maxwell3d.CallMethodFromMME(0x8e5, 0x0); 78 maxwell3d.CallMethodFromMME(0x8e5, 0x0);
79} 79}
80 80
81static const std::unordered_map<u64, HLEFunction> hle_funcs{ 81static const std::array<std::pair<u64, HLEFunction>, 3> hle_funcs{
82 {0x771BB18C62444DA0, &HLE_771BB18C62444DA0}, 82 std::make_pair<u64, HLEFunction>(0x771BB18C62444DA0, &HLE_771BB18C62444DA0),
83 {0x0D61FC9FAAC9FCAD, &HLE_0D61FC9FAAC9FCAD}, 83 std::make_pair<u64, HLEFunction>(0x0D61FC9FAAC9FCAD, &HLE_0D61FC9FAAC9FCAD),
84 {0x0217920100488FF7, &HLE_0217920100488FF7}, 84 std::make_pair<u64, HLEFunction>(0x0217920100488FF7, &HLE_0217920100488FF7),
85}; 85};
86 86
87HLEMacro::HLEMacro(Engines::Maxwell3D& maxwell3d) : maxwell3d(maxwell3d) {} 87HLEMacro::HLEMacro(Engines::Maxwell3D& maxwell3d) : maxwell3d(maxwell3d) {}
88HLEMacro::~HLEMacro() = default; 88HLEMacro::~HLEMacro() = default;
89 89
90std::optional<std::unique_ptr<CachedMacro>> HLEMacro::GetHLEProgram(u64 hash) const { 90std::optional<std::unique_ptr<CachedMacro>> HLEMacro::GetHLEProgram(u64 hash) const {
91 auto it = hle_funcs.find(hash); 91 const auto it = std::find_if(hle_funcs.begin(), hle_funcs.end(),
92 if (it != hle_funcs.end()) { 92 [hash](auto& pair) { return pair.first == hash; });
93 return std::make_unique<HLEMacroImpl>(maxwell3d, it->second); 93 if (it == hle_funcs.end()) {
94 } else { 94 return std::nullopt;
95 return {};
96 } 95 }
96 return std::make_unique<HLEMacroImpl>(maxwell3d, it->second);
97} 97}
98 98
99HLEMacroImpl::~HLEMacroImpl() = default; 99HLEMacroImpl::~HLEMacroImpl() = default;
diff --git a/src/video_core/macro/macro_hle.h b/src/video_core/macro/macro_hle.h
index de7f43dc4..7cd492a8f 100644
--- a/src/video_core/macro/macro_hle.h
+++ b/src/video_core/macro/macro_hle.h
@@ -20,7 +20,7 @@ using HLEFunction = void (*)(Engines::Maxwell3D& maxwell3d, const std::vector<u3
20 20
21class HLEMacro { 21class HLEMacro {
22public: 22public:
23 HLEMacro(Engines::Maxwell3D& maxwell3d); 23 explicit HLEMacro(Engines::Maxwell3D& maxwell3d);
24 ~HLEMacro(); 24 ~HLEMacro();
25 std::optional<std::unique_ptr<CachedMacro>> GetHLEProgram(u64 hash) const; 25 std::optional<std::unique_ptr<CachedMacro>> GetHLEProgram(u64 hash) const;
26 26