summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt14
-rw-r--r--src/core/hle/service/erpt/erpt.cpp51
-rw-r--r--src/core/hle/service/erpt/erpt.h16
-rw-r--r--src/core/hle/service/eupld/eupld.cpp52
-rw-r--r--src/core/hle/service/eupld/eupld.h16
-rw-r--r--src/core/hle/service/ldr/ldr.cpp81
-rw-r--r--src/core/hle/service/ldr/ldr.h16
-rw-r--r--src/core/hle/service/nifm/nifm.cpp47
-rw-r--r--src/core/hle/service/nifm/nifm.h19
-rw-r--r--src/core/hle/service/nifm/nifm_a.cpp17
-rw-r--r--src/core/hle/service/nifm/nifm_a.h16
-rw-r--r--src/core/hle/service/nifm/nifm_s.cpp17
-rw-r--r--src/core/hle/service/nifm/nifm_s.h16
-rw-r--r--src/core/hle/service/nifm/nifm_u.cpp17
-rw-r--r--src/core/hle/service/nifm/nifm_u.h16
-rw-r--r--src/core/hle/service/nvdrv/nvdrv.cpp10
-rw-r--r--src/core/hle/service/nvdrv/nvdrv.h2
-rw-r--r--src/core/hle/service/pm/pm.cpp70
-rw-r--r--src/core/hle/service/pm/pm.h16
-rw-r--r--src/core/hle/service/service.cpp8
-rw-r--r--src/video_core/gpu.h5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp38
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h73
-rw-r--r--src/video_core/textures/decoders.cpp3
24 files changed, 471 insertions, 165 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 87e381055..2e2de59b1 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -136,8 +136,12 @@ add_library(core STATIC
136 hle/service/bcat/bcat.h 136 hle/service/bcat/bcat.h
137 hle/service/bcat/module.cpp 137 hle/service/bcat/module.cpp
138 hle/service/bcat/module.h 138 hle/service/bcat/module.h
139 hle/service/erpt/erpt.cpp
140 hle/service/erpt/erpt.h
139 hle/service/es/es.cpp 141 hle/service/es/es.cpp
140 hle/service/es/es.h 142 hle/service/es/es.h
143 hle/service/eupld/eupld.cpp
144 hle/service/eupld/eupld.h
141 hle/service/fatal/fatal.cpp 145 hle/service/fatal/fatal.cpp
142 hle/service/fatal/fatal.h 146 hle/service/fatal/fatal.h
143 hle/service/fatal/fatal_p.cpp 147 hle/service/fatal/fatal_p.cpp
@@ -154,6 +158,8 @@ add_library(core STATIC
154 hle/service/friend/interface.h 158 hle/service/friend/interface.h
155 hle/service/hid/hid.cpp 159 hle/service/hid/hid.cpp
156 hle/service/hid/hid.h 160 hle/service/hid/hid.h
161 hle/service/ldr/ldr.cpp
162 hle/service/ldr/ldr.h
157 hle/service/lm/lm.cpp 163 hle/service/lm/lm.cpp
158 hle/service/lm/lm.h 164 hle/service/lm/lm.h
159 hle/service/mm/mm_u.cpp 165 hle/service/mm/mm_u.cpp
@@ -164,12 +170,6 @@ add_library(core STATIC
164 hle/service/nfp/nfp_user.h 170 hle/service/nfp/nfp_user.h
165 hle/service/nifm/nifm.cpp 171 hle/service/nifm/nifm.cpp
166 hle/service/nifm/nifm.h 172 hle/service/nifm/nifm.h
167 hle/service/nifm/nifm_a.cpp
168 hle/service/nifm/nifm_a.h
169 hle/service/nifm/nifm_s.cpp
170 hle/service/nifm/nifm_s.h
171 hle/service/nifm/nifm_u.cpp
172 hle/service/nifm/nifm_u.h
173 hle/service/ns/ns.cpp 173 hle/service/ns/ns.cpp
174 hle/service/ns/ns.h 174 hle/service/ns/ns.h
175 hle/service/ns/pl_u.cpp 175 hle/service/ns/pl_u.cpp
@@ -203,6 +203,8 @@ add_library(core STATIC
203 hle/service/pctl/module.h 203 hle/service/pctl/module.h
204 hle/service/pctl/pctl.cpp 204 hle/service/pctl/pctl.cpp
205 hle/service/pctl/pctl.h 205 hle/service/pctl/pctl.h
206 hle/service/pm/pm.cpp
207 hle/service/pm/pm.h
206 hle/service/prepo/prepo.cpp 208 hle/service/prepo/prepo.cpp
207 hle/service/prepo/prepo.h 209 hle/service/prepo/prepo.h
208 hle/service/service.cpp 210 hle/service/service.cpp
diff --git a/src/core/hle/service/erpt/erpt.cpp b/src/core/hle/service/erpt/erpt.cpp
new file mode 100644
index 000000000..ee11cd78e
--- /dev/null
+++ b/src/core/hle/service/erpt/erpt.cpp
@@ -0,0 +1,51 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/erpt/erpt.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::ERPT {
12
13class ErrorReportContext final : public ServiceFramework<ErrorReportContext> {
14public:
15 explicit ErrorReportContext() : ServiceFramework{"erpt:c"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "SubmitContext"},
19 {1, nullptr, "CreateReport"},
20 {2, nullptr, "Unknown1"},
21 {3, nullptr, "Unknown2"},
22 {4, nullptr, "Unknown3"},
23 {5, nullptr, "Unknown4"},
24 {6, nullptr, "Unknown5"},
25 };
26 // clang-format on
27
28 RegisterHandlers(functions);
29 }
30};
31
32class ErrorReportSession final : public ServiceFramework<ErrorReportSession> {
33public:
34 explicit ErrorReportSession() : ServiceFramework{"erpt:r"} {
35 // clang-format off
36 static const FunctionInfo functions[] = {
37 {0, nullptr, "OpenReport"},
38 {1, nullptr, "OpenManager"},
39 };
40 // clang-format on
41
42 RegisterHandlers(functions);
43 }
44};
45
46void InstallInterfaces(SM::ServiceManager& sm) {
47 std::make_shared<ErrorReportContext>()->InstallAsService(sm);
48 std::make_shared<ErrorReportSession>()->InstallAsService(sm);
49}
50
51} // namespace Service::ERPT
diff --git a/src/core/hle/service/erpt/erpt.h b/src/core/hle/service/erpt/erpt.h
new file mode 100644
index 000000000..de439ab6d
--- /dev/null
+++ b/src/core/hle/service/erpt/erpt.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::ERPT {
12
13/// Registers all ERPT services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::ERPT
diff --git a/src/core/hle/service/eupld/eupld.cpp b/src/core/hle/service/eupld/eupld.cpp
new file mode 100644
index 000000000..2df30acee
--- /dev/null
+++ b/src/core/hle/service/eupld/eupld.cpp
@@ -0,0 +1,52 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/eupld/eupld.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::EUPLD {
12
13class ErrorUploadContext final : public ServiceFramework<ErrorUploadContext> {
14public:
15 explicit ErrorUploadContext() : ServiceFramework{"eupld:c"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "SetUrl"},
19 {1, nullptr, "ImportCrt"},
20 {2, nullptr, "ImportPki"},
21 {3, nullptr, "SetAutoUpload"},
22 };
23 // clang-format on
24
25 RegisterHandlers(functions);
26 }
27};
28
29class ErrorUploadRequest final : public ServiceFramework<ErrorUploadRequest> {
30public:
31 explicit ErrorUploadRequest() : ServiceFramework{"eupld:r"} {
32 // clang-format off
33 static const FunctionInfo functions[] = {
34 {0, nullptr, "Initialize"},
35 {1, nullptr, "UploadAll"},
36 {2, nullptr, "UploadSelected"},
37 {3, nullptr, "GetUploadStatus"},
38 {4, nullptr, "CancelUpload"},
39 {5, nullptr, "GetResult"},
40 };
41 // clang-format on
42
43 RegisterHandlers(functions);
44 }
45};
46
47void InstallInterfaces(SM::ServiceManager& sm) {
48 std::make_shared<ErrorUploadContext>()->InstallAsService(sm);
49 std::make_shared<ErrorUploadRequest>()->InstallAsService(sm);
50}
51
52} // namespace Service::EUPLD
diff --git a/src/core/hle/service/eupld/eupld.h b/src/core/hle/service/eupld/eupld.h
new file mode 100644
index 000000000..6eef2c15f
--- /dev/null
+++ b/src/core/hle/service/eupld/eupld.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::EUPLD {
12
13/// Registers all EUPLD services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::EUPLD
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
new file mode 100644
index 000000000..ec32faf15
--- /dev/null
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -0,0 +1,81 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/ldr/ldr.h"
8#include "core/hle/service/service.h"
9
10namespace Service::LDR {
11
12class DebugMonitor final : public ServiceFramework<DebugMonitor> {
13public:
14 explicit DebugMonitor() : ServiceFramework{"ldr:dmnt"} {
15 // clang-format off
16 static const FunctionInfo functions[] = {
17 {0, nullptr, "AddProcessToDebugLaunchQueue"},
18 {1, nullptr, "ClearDebugLaunchQueue"},
19 {2, nullptr, "GetNsoInfos"},
20 };
21 // clang-format on
22
23 RegisterHandlers(functions);
24 }
25};
26
27class ProcessManager final : public ServiceFramework<ProcessManager> {
28public:
29 explicit ProcessManager() : ServiceFramework{"ldr:pm"} {
30 // clang-format off
31 static const FunctionInfo functions[] = {
32 {0, nullptr, "CreateProcess"},
33 {1, nullptr, "GetProgramInfo"},
34 {2, nullptr, "RegisterTitle"},
35 {3, nullptr, "UnregisterTitle"},
36 };
37 // clang-format on
38
39 RegisterHandlers(functions);
40 }
41};
42
43class Shell final : public ServiceFramework<Shell> {
44public:
45 explicit Shell() : ServiceFramework{"ldr:shel"} {
46 // clang-format off
47 static const FunctionInfo functions[] = {
48 {0, nullptr, "AddProcessToLaunchQueue"},
49 {1, nullptr, "ClearLaunchQueue"},
50 };
51 // clang-format on
52
53 RegisterHandlers(functions);
54 }
55};
56
57class RelocatableObject final : public ServiceFramework<RelocatableObject> {
58public:
59 explicit RelocatableObject() : ServiceFramework{"ldr:ro"} {
60 // clang-format off
61 static const FunctionInfo functions[] = {
62 {0, nullptr, "LoadNro"},
63 {1, nullptr, "UnloadNro"},
64 {2, nullptr, "LoadNrr"},
65 {3, nullptr, "UnloadNrr"},
66 {4, nullptr, "Initialize"},
67 };
68 // clang-format on
69
70 RegisterHandlers(functions);
71 }
72};
73
74void InstallInterfaces(SM::ServiceManager& sm) {
75 std::make_shared<DebugMonitor>()->InstallAsService(sm);
76 std::make_shared<ProcessManager>()->InstallAsService(sm);
77 std::make_shared<Shell>()->InstallAsService(sm);
78 std::make_shared<RelocatableObject>()->InstallAsService(sm);
79}
80
81} // namespace Service::LDR
diff --git a/src/core/hle/service/ldr/ldr.h b/src/core/hle/service/ldr/ldr.h
new file mode 100644
index 000000000..412410c4f
--- /dev/null
+++ b/src/core/hle/service/ldr/ldr.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::LDR {
12
13/// Registers all LDR services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::LDR
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp
index 0d951084b..cfe8d9178 100644
--- a/src/core/hle/service/nifm/nifm.cpp
+++ b/src/core/hle/service/nifm/nifm.cpp
@@ -5,9 +5,7 @@
5#include "core/hle/ipc_helpers.h" 5#include "core/hle/ipc_helpers.h"
6#include "core/hle/kernel/event.h" 6#include "core/hle/kernel/event.h"
7#include "core/hle/service/nifm/nifm.h" 7#include "core/hle/service/nifm/nifm.h"
8#include "core/hle/service/nifm/nifm_a.h" 8#include "core/hle/service/service.h"
9#include "core/hle/service/nifm/nifm_s.h"
10#include "core/hle/service/nifm/nifm_u.h"
11 9
12namespace Service::NIFM { 10namespace Service::NIFM {
13 11
@@ -210,28 +208,35 @@ IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") {
210 RegisterHandlers(functions); 208 RegisterHandlers(functions);
211} 209}
212 210
213void Module::Interface::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { 211class NetworkInterface final : public ServiceFramework<NetworkInterface> {
214 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 212public:
215 rb.Push(RESULT_SUCCESS); 213 explicit NetworkInterface(const char* name) : ServiceFramework{name} {
216 rb.PushIpcInterface<IGeneralService>(); 214 static const FunctionInfo functions[] = {
217 LOG_DEBUG(Service_NIFM, "called"); 215 {4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
218} 216 {5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"},
217 };
218 RegisterHandlers(functions);
219 }
219 220
220void Module::Interface::CreateGeneralService(Kernel::HLERequestContext& ctx) { 221 void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) {
221 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 222 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
222 rb.Push(RESULT_SUCCESS); 223 rb.Push(RESULT_SUCCESS);
223 rb.PushIpcInterface<IGeneralService>(); 224 rb.PushIpcInterface<IGeneralService>();
224 LOG_DEBUG(Service_NIFM, "called"); 225 LOG_DEBUG(Service_NIFM, "called");
225} 226 }
226 227
227Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) 228 void CreateGeneralService(Kernel::HLERequestContext& ctx) {
228 : ServiceFramework(name), module(std::move(module)) {} 229 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
230 rb.Push(RESULT_SUCCESS);
231 rb.PushIpcInterface<IGeneralService>();
232 LOG_DEBUG(Service_NIFM, "called");
233 }
234};
229 235
230void InstallInterfaces(SM::ServiceManager& service_manager) { 236void InstallInterfaces(SM::ServiceManager& service_manager) {
231 auto module = std::make_shared<Module>(); 237 std::make_shared<NetworkInterface>("nifm:a")->InstallAsService(service_manager);
232 std::make_shared<NIFM_A>(module)->InstallAsService(service_manager); 238 std::make_shared<NetworkInterface>("nifm:s")->InstallAsService(service_manager);
233 std::make_shared<NIFM_S>(module)->InstallAsService(service_manager); 239 std::make_shared<NetworkInterface>("nifm:u")->InstallAsService(service_manager);
234 std::make_shared<NIFM_U>(module)->InstallAsService(service_manager);
235} 240}
236 241
237} // namespace Service::NIFM 242} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h
index 11f1b5831..4616b3b48 100644
--- a/src/core/hle/service/nifm/nifm.h
+++ b/src/core/hle/service/nifm/nifm.h
@@ -4,24 +4,13 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/service/service.h" 7namespace Service::SM {
8class ServiceManager;
9}
8 10
9namespace Service::NIFM { 11namespace Service::NIFM {
10 12
11class Module final { 13/// Registers all NIFM services with the specified service manager.
12public:
13 class Interface : public ServiceFramework<Interface> {
14 public:
15 explicit Interface(std::shared_ptr<Module> module, const char* name);
16
17 void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx);
18 void CreateGeneralService(Kernel::HLERequestContext& ctx);
19
20 protected:
21 std::shared_ptr<Module> module;
22 };
23};
24
25void InstallInterfaces(SM::ServiceManager& service_manager); 14void InstallInterfaces(SM::ServiceManager& service_manager);
26 15
27} // namespace Service::NIFM 16} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_a.cpp b/src/core/hle/service/nifm/nifm_a.cpp
deleted file mode 100644
index b7f296a20..000000000
--- a/src/core/hle/service/nifm/nifm_a.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/nifm/nifm_a.h"
6
7namespace Service::NIFM {
8
9NIFM_A::NIFM_A(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:a") {
10 static const FunctionInfo functions[] = {
11 {4, &NIFM_A::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
12 {5, &NIFM_A::CreateGeneralService, "CreateGeneralService"},
13 };
14 RegisterHandlers(functions);
15}
16
17} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_a.h b/src/core/hle/service/nifm/nifm_a.h
deleted file mode 100644
index c3ba33110..000000000
--- a/src/core/hle/service/nifm/nifm_a.h
+++ /dev/null
@@ -1,16 +0,0 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/nifm/nifm.h"
8
9namespace Service::NIFM {
10
11class NIFM_A final : public Module::Interface {
12public:
13 explicit NIFM_A(std::shared_ptr<Module> module);
14};
15
16} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_s.cpp b/src/core/hle/service/nifm/nifm_s.cpp
deleted file mode 100644
index 96e3c0cee..000000000
--- a/src/core/hle/service/nifm/nifm_s.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/nifm/nifm_s.h"
6
7namespace Service::NIFM {
8
9NIFM_S::NIFM_S(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:s") {
10 static const FunctionInfo functions[] = {
11 {4, &NIFM_S::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
12 {5, &NIFM_S::CreateGeneralService, "CreateGeneralService"},
13 };
14 RegisterHandlers(functions);
15}
16
17} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_s.h b/src/core/hle/service/nifm/nifm_s.h
deleted file mode 100644
index 8d1635a5d..000000000
--- a/src/core/hle/service/nifm/nifm_s.h
+++ /dev/null
@@ -1,16 +0,0 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/nifm/nifm.h"
8
9namespace Service::NIFM {
10
11class NIFM_S final : public Module::Interface {
12public:
13 explicit NIFM_S(std::shared_ptr<Module> module);
14};
15
16} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_u.cpp b/src/core/hle/service/nifm/nifm_u.cpp
deleted file mode 100644
index 8cb75b903..000000000
--- a/src/core/hle/service/nifm/nifm_u.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/nifm/nifm_u.h"
6
7namespace Service::NIFM {
8
9NIFM_U::NIFM_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:u") {
10 static const FunctionInfo functions[] = {
11 {4, &NIFM_U::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
12 {5, &NIFM_U::CreateGeneralService, "CreateGeneralService"},
13 };
14 RegisterHandlers(functions);
15}
16
17} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_u.h b/src/core/hle/service/nifm/nifm_u.h
deleted file mode 100644
index def9726b1..000000000
--- a/src/core/hle/service/nifm/nifm_u.h
+++ /dev/null
@@ -1,16 +0,0 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/nifm/nifm.h"
8
9namespace Service::NIFM {
10
11class NIFM_U final : public Module::Interface {
12public:
13 explicit NIFM_U(std::shared_ptr<Module> module);
14};
15
16} // namespace Service::NIFM
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp
index cc5cfe34e..1555ea806 100644
--- a/src/core/hle/service/nvdrv/nvdrv.cpp
+++ b/src/core/hle/service/nvdrv/nvdrv.cpp
@@ -2,6 +2,8 @@
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 <utility>
6
5#include "core/hle/ipc_helpers.h" 7#include "core/hle/ipc_helpers.h"
6#include "core/hle/service/nvdrv/devices/nvdevice.h" 8#include "core/hle/service/nvdrv/devices/nvdevice.h"
7#include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" 9#include "core/hle/service/nvdrv/devices/nvdisp_disp0.h"
@@ -40,14 +42,14 @@ Module::Module() {
40 devices["/dev/nvhost-nvdec"] = std::make_shared<Devices::nvhost_nvdec>(); 42 devices["/dev/nvhost-nvdec"] = std::make_shared<Devices::nvhost_nvdec>();
41} 43}
42 44
43u32 Module::Open(std::string device_name) { 45u32 Module::Open(const std::string& device_name) {
44 ASSERT_MSG(devices.find(device_name) != devices.end(), "Trying to open unknown device {}", 46 ASSERT_MSG(devices.find(device_name) != devices.end(), "Trying to open unknown device {}",
45 device_name); 47 device_name);
46 48
47 auto device = devices[device_name]; 49 auto device = devices[device_name];
48 u32 fd = next_fd++; 50 const u32 fd = next_fd++;
49 51
50 open_files[fd] = device; 52 open_files[fd] = std::move(device);
51 53
52 return fd; 54 return fd;
53} 55}
@@ -56,7 +58,7 @@ u32 Module::Ioctl(u32 fd, u32_le command, const std::vector<u8>& input, std::vec
56 auto itr = open_files.find(fd); 58 auto itr = open_files.find(fd);
57 ASSERT_MSG(itr != open_files.end(), "Tried to talk to an invalid device"); 59 ASSERT_MSG(itr != open_files.end(), "Tried to talk to an invalid device");
58 60
59 auto device = itr->second; 61 auto& device = itr->second;
60 return device->ioctl({command}, input, output); 62 return device->ioctl({command}, input, output);
61} 63}
62 64
diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h
index 35b2c65fc..184f3c9fc 100644
--- a/src/core/hle/service/nvdrv/nvdrv.h
+++ b/src/core/hle/service/nvdrv/nvdrv.h
@@ -38,7 +38,7 @@ public:
38 } 38 }
39 39
40 /// Opens a device node and returns a file descriptor to it. 40 /// Opens a device node and returns a file descriptor to it.
41 u32 Open(std::string device_name); 41 u32 Open(const std::string& device_name);
42 /// Sends an ioctl command to the specified file descriptor. 42 /// Sends an ioctl command to the specified file descriptor.
43 u32 Ioctl(u32 fd, u32 command, const std::vector<u8>& input, std::vector<u8>& output); 43 u32 Ioctl(u32 fd, u32 command, const std::vector<u8>& input, std::vector<u8>& output);
44 /// Closes a device file descriptor and returns operation success. 44 /// Closes a device file descriptor and returns operation success.
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp
new file mode 100644
index 000000000..e20a25689
--- /dev/null
+++ b/src/core/hle/service/pm/pm.cpp
@@ -0,0 +1,70 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/service.h"
6
7namespace Service::PM {
8
9class BootMode final : public ServiceFramework<BootMode> {
10public:
11 explicit BootMode() : ServiceFramework{"pm:bm"} {
12 static const FunctionInfo functions[] = {
13 {0, nullptr, "GetBootMode"},
14 {1, nullptr, "SetMaintenanceBoot"},
15 };
16 RegisterHandlers(functions);
17 }
18};
19
20class DebugMonitor final : public ServiceFramework<DebugMonitor> {
21public:
22 explicit DebugMonitor() : ServiceFramework{"pm:dmnt"} {
23 static const FunctionInfo functions[] = {
24 {0, nullptr, "IsDebugMode"},
25 {1, nullptr, "GetDebugProcesses"},
26 {2, nullptr, "StartDebugProcess"},
27 {3, nullptr, "GetTitlePid"},
28 {4, nullptr, "EnableDebugForTitleId"},
29 {5, nullptr, "GetApplicationPid"},
30 {6, nullptr, "EnableDebugForApplication"},
31 };
32 RegisterHandlers(functions);
33 }
34};
35
36class Info final : public ServiceFramework<Info> {
37public:
38 explicit Info() : ServiceFramework{"pm:info"} {
39 static const FunctionInfo functions[] = {
40 {0, nullptr, "GetTitleId"},
41 };
42 RegisterHandlers(functions);
43 }
44};
45
46class Shell final : public ServiceFramework<Shell> {
47public:
48 explicit Shell() : ServiceFramework{"pm:shell"} {
49 static const FunctionInfo functions[] = {
50 {0, nullptr, "LaunchProcess"},
51 {1, nullptr, "TerminateProcessByPid"},
52 {2, nullptr, "TerminateProcessByTitleId"},
53 {3, nullptr, "GetProcessEventWaiter"},
54 {4, nullptr, "GetProcessEventType"},
55 {5, nullptr, "NotifyBootFinished"},
56 {6, nullptr, "GetApplicationPid"},
57 {7, nullptr, "BoostSystemMemoryResourceLimit"},
58 };
59 RegisterHandlers(functions);
60 }
61};
62
63void InstallInterfaces(SM::ServiceManager& sm) {
64 std::make_shared<BootMode>()->InstallAsService(sm);
65 std::make_shared<DebugMonitor>()->InstallAsService(sm);
66 std::make_shared<Info>()->InstallAsService(sm);
67 std::make_shared<Shell>()->InstallAsService(sm);
68}
69
70} // namespace Service::PM
diff --git a/src/core/hle/service/pm/pm.h b/src/core/hle/service/pm/pm.h
new file mode 100644
index 000000000..9fc19fed6
--- /dev/null
+++ b/src/core/hle/service/pm/pm.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::PM {
12
13/// Registers all PM services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& service_manager);
15
16} // namespace Service::PM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index b70d0d517..482989ea7 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -21,11 +21,14 @@
21#include "core/hle/service/apm/apm.h" 21#include "core/hle/service/apm/apm.h"
22#include "core/hle/service/audio/audio.h" 22#include "core/hle/service/audio/audio.h"
23#include "core/hle/service/bcat/bcat.h" 23#include "core/hle/service/bcat/bcat.h"
24#include "core/hle/service/erpt/erpt.h"
24#include "core/hle/service/es/es.h" 25#include "core/hle/service/es/es.h"
26#include "core/hle/service/eupld/eupld.h"
25#include "core/hle/service/fatal/fatal.h" 27#include "core/hle/service/fatal/fatal.h"
26#include "core/hle/service/filesystem/filesystem.h" 28#include "core/hle/service/filesystem/filesystem.h"
27#include "core/hle/service/friend/friend.h" 29#include "core/hle/service/friend/friend.h"
28#include "core/hle/service/hid/hid.h" 30#include "core/hle/service/hid/hid.h"
31#include "core/hle/service/ldr/ldr.h"
29#include "core/hle/service/lm/lm.h" 32#include "core/hle/service/lm/lm.h"
30#include "core/hle/service/mm/mm_u.h" 33#include "core/hle/service/mm/mm_u.h"
31#include "core/hle/service/nfp/nfp.h" 34#include "core/hle/service/nfp/nfp.h"
@@ -33,6 +36,7 @@
33#include "core/hle/service/ns/ns.h" 36#include "core/hle/service/ns/ns.h"
34#include "core/hle/service/nvdrv/nvdrv.h" 37#include "core/hle/service/nvdrv/nvdrv.h"
35#include "core/hle/service/pctl/pctl.h" 38#include "core/hle/service/pctl/pctl.h"
39#include "core/hle/service/pm/pm.h"
36#include "core/hle/service/prepo/prepo.h" 40#include "core/hle/service/prepo/prepo.h"
37#include "core/hle/service/service.h" 41#include "core/hle/service/service.h"
38#include "core/hle/service/set/settings.h" 42#include "core/hle/service/set/settings.h"
@@ -188,11 +192,14 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
188 APM::InstallInterfaces(*sm); 192 APM::InstallInterfaces(*sm);
189 BCAT::InstallInterfaces(*sm); 193 BCAT::InstallInterfaces(*sm);
190 Audio::InstallInterfaces(*sm); 194 Audio::InstallInterfaces(*sm);
195 ERPT::InstallInterfaces(*sm);
191 ES::InstallInterfaces(*sm); 196 ES::InstallInterfaces(*sm);
197 EUPLD::InstallInterfaces(*sm);
192 Fatal::InstallInterfaces(*sm); 198 Fatal::InstallInterfaces(*sm);
193 FileSystem::InstallInterfaces(*sm); 199 FileSystem::InstallInterfaces(*sm);
194 Friend::InstallInterfaces(*sm); 200 Friend::InstallInterfaces(*sm);
195 HID::InstallInterfaces(*sm); 201 HID::InstallInterfaces(*sm);
202 LDR::InstallInterfaces(*sm);
196 LM::InstallInterfaces(*sm); 203 LM::InstallInterfaces(*sm);
197 MM::InstallInterfaces(*sm); 204 MM::InstallInterfaces(*sm);
198 NFP::InstallInterfaces(*sm); 205 NFP::InstallInterfaces(*sm);
@@ -201,6 +208,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
201 Nvidia::InstallInterfaces(*sm); 208 Nvidia::InstallInterfaces(*sm);
202 PCTL::InstallInterfaces(*sm); 209 PCTL::InstallInterfaces(*sm);
203 PlayReport::InstallInterfaces(*sm); 210 PlayReport::InstallInterfaces(*sm);
211 PM::InstallInterfaces(*sm);
204 Sockets::InstallInterfaces(*sm); 212 Sockets::InstallInterfaces(*sm);
205 SPL::InstallInterfaces(*sm); 213 SPL::InstallInterfaces(*sm);
206 SSL::InstallInterfaces(*sm); 214 SSL::InstallInterfaces(*sm);
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index e9d87efb4..de276c559 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -23,6 +23,11 @@ enum class RenderTargetFormat : u32 {
23 RGB10_A2_UNORM = 0xD1, 23 RGB10_A2_UNORM = 0xD1,
24 RGBA8_UNORM = 0xD5, 24 RGBA8_UNORM = 0xD5,
25 RGBA8_SRGB = 0xD6, 25 RGBA8_SRGB = 0xD6,
26 RG16_UNORM = 0xDA,
27 RG16_SNORM = 0xDB,
28 RG16_SINT = 0xDC,
29 RG16_UINT = 0xDD,
30 RG16_FLOAT = 0xDE,
26 R11G11B10_FLOAT = 0xE0, 31 R11G11B10_FLOAT = 0xE0,
27 R8_UNORM = 0xF3, 32 R8_UNORM = 0xF3,
28}; 33};
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index f52ac23f1..a4d9707cb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -104,15 +104,20 @@ static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_form
104 true}, // DXT45 104 true}, // DXT45
105 {GL_COMPRESSED_RED_RGTC1, GL_RED, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm, true}, // DXN1 105 {GL_COMPRESSED_RED_RGTC1, GL_RED, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm, true}, // DXN1
106 {GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm, 106 {GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm,
107 true}, // BC7U 107 true}, // BC7U
108 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_4X4 108 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_4X4
109 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // G8R8 109 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // G8R8
110 {GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // BGRA8 110 {GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // BGRA8
111 {GL_RGBA32F, GL_RGBA, GL_FLOAT, ComponentType::Float, false}, // RGBA32F 111 {GL_RGBA32F, GL_RGBA, GL_FLOAT, ComponentType::Float, false}, // RGBA32F
112 {GL_RG32F, GL_RG, GL_FLOAT, ComponentType::Float, false}, // RG32F 112 {GL_RG32F, GL_RG, GL_FLOAT, ComponentType::Float, false}, // RG32F
113 {GL_R32F, GL_RED, GL_FLOAT, ComponentType::Float, false}, // R32F 113 {GL_R32F, GL_RED, GL_FLOAT, ComponentType::Float, false}, // R32F
114 {GL_R16F, GL_RED, GL_HALF_FLOAT, ComponentType::Float, false}, // R16F 114 {GL_R16F, GL_RED, GL_HALF_FLOAT, ComponentType::Float, false}, // R16F
115 {GL_R16, GL_RED, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // R16UNORM 115 {GL_R16, GL_RED, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // R16UNORM
116 {GL_RG16, GL_RG, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // RG16
117 {GL_RG16F, GL_RG, GL_HALF_FLOAT, ComponentType::Float, false}, // RG16F
118 {GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT, ComponentType::UInt, false}, // RG16UI
119 {GL_RG16I, GL_RG_INTEGER, GL_SHORT, ComponentType::SInt, false}, // RG16I
120 {GL_RG16_SNORM, GL_RG, GL_SHORT, ComponentType::SNorm, false}, // RG16S
116 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, ComponentType::UNorm, false}, // SRGBA8 121 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, ComponentType::UNorm, false}, // SRGBA8
117 122
118 // DepthStencil formats 123 // DepthStencil formats
@@ -210,10 +215,12 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
210 MortonCopy<true, PixelFormat::G8R8>, MortonCopy<true, PixelFormat::BGRA8>, 215 MortonCopy<true, PixelFormat::G8R8>, MortonCopy<true, PixelFormat::BGRA8>,
211 MortonCopy<true, PixelFormat::RGBA32F>, MortonCopy<true, PixelFormat::RG32F>, 216 MortonCopy<true, PixelFormat::RGBA32F>, MortonCopy<true, PixelFormat::RG32F>,
212 MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::R16F>, 217 MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::R16F>,
213 MortonCopy<true, PixelFormat::R16UNORM>, MortonCopy<true, PixelFormat::SRGBA8>, 218 MortonCopy<true, PixelFormat::R16UNORM>, MortonCopy<true, PixelFormat::RG16>,
214 MortonCopy<true, PixelFormat::Z24S8>, MortonCopy<true, PixelFormat::S8Z24>, 219 MortonCopy<true, PixelFormat::RG16F>, MortonCopy<true, PixelFormat::RG16UI>,
215 MortonCopy<true, PixelFormat::Z32F>, MortonCopy<true, PixelFormat::Z16>, 220 MortonCopy<true, PixelFormat::RG16I>, MortonCopy<true, PixelFormat::RG16S>,
216 MortonCopy<true, PixelFormat::Z32FS8>, 221 MortonCopy<true, PixelFormat::SRGBA8>, MortonCopy<true, PixelFormat::Z24S8>,
222 MortonCopy<true, PixelFormat::S8Z24>, MortonCopy<true, PixelFormat::Z32F>,
223 MortonCopy<true, PixelFormat::Z16>, MortonCopy<true, PixelFormat::Z32FS8>,
217}; 224};
218 225
219static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr), 226static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
@@ -241,6 +248,11 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
241 MortonCopy<false, PixelFormat::R32F>, 248 MortonCopy<false, PixelFormat::R32F>,
242 MortonCopy<false, PixelFormat::R16F>, 249 MortonCopy<false, PixelFormat::R16F>,
243 MortonCopy<false, PixelFormat::R16UNORM>, 250 MortonCopy<false, PixelFormat::R16UNORM>,
251 MortonCopy<false, PixelFormat::RG16>,
252 MortonCopy<false, PixelFormat::RG16F>,
253 MortonCopy<false, PixelFormat::RG16UI>,
254 MortonCopy<false, PixelFormat::RG16I>,
255 MortonCopy<false, PixelFormat::RG16S>,
244 MortonCopy<false, PixelFormat::SRGBA8>, 256 MortonCopy<false, PixelFormat::SRGBA8>,
245 MortonCopy<false, PixelFormat::Z24S8>, 257 MortonCopy<false, PixelFormat::Z24S8>,
246 MortonCopy<false, PixelFormat::S8Z24>, 258 MortonCopy<false, PixelFormat::S8Z24>,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index ffa2019f7..bb39c0a6f 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -43,16 +43,21 @@ struct SurfaceParams {
43 R32F = 18, 43 R32F = 18,
44 R16F = 19, 44 R16F = 19,
45 R16UNORM = 20, 45 R16UNORM = 20,
46 SRGBA8 = 21, 46 RG16 = 21,
47 RG16F = 22,
48 RG16UI = 23,
49 RG16I = 24,
50 RG16S = 25,
51 SRGBA8 = 26,
47 52
48 MaxColorFormat, 53 MaxColorFormat,
49 54
50 // DepthStencil formats 55 // DepthStencil formats
51 Z24S8 = 22, 56 Z24S8 = 27,
52 S8Z24 = 23, 57 S8Z24 = 28,
53 Z32F = 24, 58 Z32F = 29,
54 Z16 = 25, 59 Z16 = 30,
55 Z32FS8 = 26, 60 Z32FS8 = 31,
56 61
57 MaxDepthStencilFormat, 62 MaxDepthStencilFormat,
58 63
@@ -111,6 +116,11 @@ struct SurfaceParams {
111 1, // R32F 116 1, // R32F
112 1, // R16F 117 1, // R16F
113 1, // R16UNORM 118 1, // R16UNORM
119 1, // RG16
120 1, // RG16F
121 1, // RG16UI
122 1, // RG16I
123 1, // RG16S
114 1, // SRGBA8 124 1, // SRGBA8
115 1, // Z24S8 125 1, // Z24S8
116 1, // S8Z24 126 1, // S8Z24
@@ -149,6 +159,11 @@ struct SurfaceParams {
149 32, // R32F 159 32, // R32F
150 16, // R16F 160 16, // R16F
151 16, // R16UNORM 161 16, // R16UNORM
162 32, // RG16
163 32, // RG16F
164 32, // RG16UI
165 32, // RG16I
166 32, // RG16S
152 32, // SRGBA8 167 32, // SRGBA8
153 32, // Z24S8 168 32, // Z24S8
154 32, // S8Z24 169 32, // S8Z24
@@ -205,6 +220,17 @@ struct SurfaceParams {
205 return PixelFormat::RGBA32UI; 220 return PixelFormat::RGBA32UI;
206 case Tegra::RenderTargetFormat::R8_UNORM: 221 case Tegra::RenderTargetFormat::R8_UNORM:
207 return PixelFormat::R8; 222 return PixelFormat::R8;
223 case Tegra::RenderTargetFormat::RG16_FLOAT:
224 return PixelFormat::RG16F;
225 case Tegra::RenderTargetFormat::RG16_UINT:
226 return PixelFormat::RG16UI;
227 case Tegra::RenderTargetFormat::RG16_SINT:
228 return PixelFormat::RG16I;
229 case Tegra::RenderTargetFormat::RG16_UNORM:
230 return PixelFormat::RG16;
231 case Tegra::RenderTargetFormat::RG16_SNORM:
232 return PixelFormat::RG16S;
233
208 default: 234 default:
209 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 235 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
210 UNREACHABLE(); 236 UNREACHABLE();
@@ -271,6 +297,22 @@ struct SurfaceParams {
271 return PixelFormat::BC7U; 297 return PixelFormat::BC7U;
272 case Tegra::Texture::TextureFormat::ASTC_2D_4X4: 298 case Tegra::Texture::TextureFormat::ASTC_2D_4X4:
273 return PixelFormat::ASTC_2D_4X4; 299 return PixelFormat::ASTC_2D_4X4;
300 case Tegra::Texture::TextureFormat::R16_G16:
301 switch (component_type) {
302 case Tegra::Texture::ComponentType::FLOAT:
303 return PixelFormat::RG16F;
304 case Tegra::Texture::ComponentType::UNORM:
305 return PixelFormat::RG16;
306 case Tegra::Texture::ComponentType::SNORM:
307 return PixelFormat::RG16S;
308 case Tegra::Texture::ComponentType::UINT:
309 return PixelFormat::RG16UI;
310 case Tegra::Texture::ComponentType::SINT:
311 return PixelFormat::RG16I;
312 }
313 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}",
314 static_cast<u32>(component_type));
315 UNREACHABLE();
274 default: 316 default:
275 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", 317 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}",
276 static_cast<u32>(format), static_cast<u32>(component_type)); 318 static_cast<u32>(format), static_cast<u32>(component_type));
@@ -329,6 +371,12 @@ struct SurfaceParams {
329 return Tegra::Texture::TextureFormat::ZF32; 371 return Tegra::Texture::TextureFormat::ZF32;
330 case PixelFormat::Z24S8: 372 case PixelFormat::Z24S8:
331 return Tegra::Texture::TextureFormat::Z24S8; 373 return Tegra::Texture::TextureFormat::Z24S8;
374 case PixelFormat::RG16F:
375 case PixelFormat::RG16:
376 case PixelFormat::RG16UI:
377 case PixelFormat::RG16I:
378 case PixelFormat::RG16S:
379 return Tegra::Texture::TextureFormat::R16_G16;
332 default: 380 default:
333 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 381 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
334 UNREACHABLE(); 382 UNREACHABLE();
@@ -360,6 +408,12 @@ struct SurfaceParams {
360 return ComponentType::UNorm; 408 return ComponentType::UNorm;
361 case Tegra::Texture::ComponentType::FLOAT: 409 case Tegra::Texture::ComponentType::FLOAT:
362 return ComponentType::Float; 410 return ComponentType::Float;
411 case Tegra::Texture::ComponentType::SNORM:
412 return ComponentType::SNorm;
413 case Tegra::Texture::ComponentType::UINT:
414 return ComponentType::UInt;
415 case Tegra::Texture::ComponentType::SINT:
416 return ComponentType::SInt;
363 default: 417 default:
364 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type)); 418 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
365 UNREACHABLE(); 419 UNREACHABLE();
@@ -374,14 +428,21 @@ struct SurfaceParams {
374 case Tegra::RenderTargetFormat::BGRA8_UNORM: 428 case Tegra::RenderTargetFormat::BGRA8_UNORM:
375 case Tegra::RenderTargetFormat::RGB10_A2_UNORM: 429 case Tegra::RenderTargetFormat::RGB10_A2_UNORM:
376 case Tegra::RenderTargetFormat::R8_UNORM: 430 case Tegra::RenderTargetFormat::R8_UNORM:
431 case Tegra::RenderTargetFormat::RG16_UNORM:
377 return ComponentType::UNorm; 432 return ComponentType::UNorm;
433 case Tegra::RenderTargetFormat::RG16_SNORM:
434 return ComponentType::SNorm;
378 case Tegra::RenderTargetFormat::RGBA16_FLOAT: 435 case Tegra::RenderTargetFormat::RGBA16_FLOAT:
379 case Tegra::RenderTargetFormat::R11G11B10_FLOAT: 436 case Tegra::RenderTargetFormat::R11G11B10_FLOAT:
380 case Tegra::RenderTargetFormat::RGBA32_FLOAT: 437 case Tegra::RenderTargetFormat::RGBA32_FLOAT:
381 case Tegra::RenderTargetFormat::RG32_FLOAT: 438 case Tegra::RenderTargetFormat::RG32_FLOAT:
439 case Tegra::RenderTargetFormat::RG16_FLOAT:
382 return ComponentType::Float; 440 return ComponentType::Float;
383 case Tegra::RenderTargetFormat::RGBA32_UINT: 441 case Tegra::RenderTargetFormat::RGBA32_UINT:
442 case Tegra::RenderTargetFormat::RG16_UINT:
384 return ComponentType::UInt; 443 return ComponentType::UInt;
444 case Tegra::RenderTargetFormat::RG16_SINT:
445 return ComponentType::SInt;
385 default: 446 default:
386 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 447 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
387 UNREACHABLE(); 448 UNREACHABLE();
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 50c5a56f6..d794f8402 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -62,6 +62,7 @@ u32 BytesPerPixel(TextureFormat format) {
62 case TextureFormat::A2B10G10R10: 62 case TextureFormat::A2B10G10R10:
63 case TextureFormat::BF10GF11RF11: 63 case TextureFormat::BF10GF11RF11:
64 case TextureFormat::R32: 64 case TextureFormat::R32:
65 case TextureFormat::R16_G16:
65 return 4; 66 return 4;
66 case TextureFormat::A1B5G5R5: 67 case TextureFormat::A1B5G5R5:
67 case TextureFormat::B5G6R5: 68 case TextureFormat::B5G6R5:
@@ -127,6 +128,7 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width,
127 case TextureFormat::R32_G32: 128 case TextureFormat::R32_G32:
128 case TextureFormat::R32: 129 case TextureFormat::R32:
129 case TextureFormat::R16: 130 case TextureFormat::R16:
131 case TextureFormat::R16_G16:
130 case TextureFormat::BF10GF11RF11: 132 case TextureFormat::BF10GF11RF11:
131 case TextureFormat::ASTC_2D_4X4: 133 case TextureFormat::ASTC_2D_4X4:
132 CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data, 134 CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
@@ -187,6 +189,7 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
187 case TextureFormat::R32_G32: 189 case TextureFormat::R32_G32:
188 case TextureFormat::R32: 190 case TextureFormat::R32:
189 case TextureFormat::R16: 191 case TextureFormat::R16:
192 case TextureFormat::R16_G16:
190 // TODO(Subv): For the time being just forward the same data without any decoding. 193 // TODO(Subv): For the time being just forward the same data without any decoding.
191 rgba_data = texture_data; 194 rgba_data = texture_data;
192 break; 195 break;