summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/hle/service/ldn/ldn.cpp142
-rw-r--r--src/core/hle/service/ldn/ldn.h16
-rw-r--r--src/core/hle/service/lm/lm.cpp60
-rw-r--r--src/core/hle/service/lm/lm.h15
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/core/hle/service/sockets/bsd.cpp22
-rw-r--r--src/core/hle/service/sockets/bsd.h5
-rw-r--r--src/core/hle/service/sockets/ethc.cpp38
-rw-r--r--src/core/hle/service/sockets/ethc.h21
-rw-r--r--src/core/hle/service/sockets/sockets.cpp7
-rw-r--r--src/video_core/gpu.h6
-rw-r--r--src/video_core/memory_manager.cpp36
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp38
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h75
-rw-r--r--src/video_core/textures/decoders.cpp3
18 files changed, 419 insertions, 73 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 59b999935..ad9edbcdf 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -173,6 +173,7 @@ void FileBackend::Write(const Entry& entry) {
173 SUB(Service, Friend) \ 173 SUB(Service, Friend) \
174 SUB(Service, FS) \ 174 SUB(Service, FS) \
175 SUB(Service, HID) \ 175 SUB(Service, HID) \
176 SUB(Service, LDN) \
176 SUB(Service, LM) \ 177 SUB(Service, LM) \
177 SUB(Service, MM) \ 178 SUB(Service, MM) \
178 SUB(Service, NFP) \ 179 SUB(Service, NFP) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index e7115933f..ad3cbf5d1 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -60,6 +60,7 @@ enum class Class : ClassType {
60 Service_Friend, ///< The friend service 60 Service_Friend, ///< The friend service
61 Service_FS, ///< The FS (Filesystem) service 61 Service_FS, ///< The FS (Filesystem) service
62 Service_HID, ///< The HID (Human interface device) service 62 Service_HID, ///< The HID (Human interface device) service
63 Service_LDN, ///< The LDN (Local domain network) service
63 Service_LM, ///< The LM (Logger) service 64 Service_LM, ///< The LM (Logger) service
64 Service_MM, ///< The MM (Multimedia) service 65 Service_MM, ///< The MM (Multimedia) service
65 Service_NFP, ///< The NFP service 66 Service_NFP, ///< The NFP service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 4c0b6dbc0..7b586eaa8 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -158,6 +158,8 @@ add_library(core STATIC
158 hle/service/friend/interface.h 158 hle/service/friend/interface.h
159 hle/service/hid/hid.cpp 159 hle/service/hid/hid.cpp
160 hle/service/hid/hid.h 160 hle/service/hid/hid.h
161 hle/service/ldn/ldn.cpp
162 hle/service/ldn/ldn.h
161 hle/service/ldr/ldr.cpp 163 hle/service/ldr/ldr.cpp
162 hle/service/ldr/ldr.h 164 hle/service/ldr/ldr.h
163 hle/service/lm/lm.cpp 165 hle/service/lm/lm.cpp
@@ -227,6 +229,8 @@ add_library(core STATIC
227 hle/service/sm/sm.h 229 hle/service/sm/sm.h
228 hle/service/sockets/bsd.cpp 230 hle/service/sockets/bsd.cpp
229 hle/service/sockets/bsd.h 231 hle/service/sockets/bsd.h
232 hle/service/sockets/ethc.cpp
233 hle/service/sockets/ethc.h
230 hle/service/sockets/nsd.cpp 234 hle/service/sockets/nsd.cpp
231 hle/service/sockets/nsd.h 235 hle/service/sockets/nsd.h
232 hle/service/sockets/sfdnsres.cpp 236 hle/service/sockets/sfdnsres.cpp
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp
new file mode 100644
index 000000000..167f2c66a
--- /dev/null
+++ b/src/core/hle/service/ldn/ldn.cpp
@@ -0,0 +1,142 @@
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/ipc_helpers.h"
8#include "core/hle/result.h"
9#include "core/hle/service/ldn/ldn.h"
10#include "core/hle/service/sm/sm.h"
11
12namespace Service::LDN {
13
14class IMonitorService final : public ServiceFramework<IMonitorService> {
15public:
16 explicit IMonitorService() : ServiceFramework{"IMonitorService"} {
17 // clang-format off
18 static const FunctionInfo functions[] = {
19 {0, nullptr, "GetStateForMonitor"},
20 {1, nullptr, "GetNetworkInfoForMonitor"},
21 {2, nullptr, "GetIpv4AddressForMonitor"},
22 {3, nullptr, "GetDisconnectReasonForMonitor"},
23 {4, nullptr, "GetSecurityParameterForMonitor"},
24 {5, nullptr, "GetNetworkConfigForMonitor"},
25 {100, nullptr, "InitializeMonitor"},
26 {101, nullptr, "FinalizeMonitor"},
27 };
28 // clang-format on
29
30 RegisterHandlers(functions);
31 }
32};
33
34class LDNM final : public ServiceFramework<LDNM> {
35public:
36 explicit LDNM() : ServiceFramework{"ldn:m"} {
37 // clang-format off
38 static const FunctionInfo functions[] = {
39 {0, &LDNM::CreateMonitorService, "CreateMonitorService"}
40 };
41 // clang-format on
42
43 RegisterHandlers(functions);
44 }
45
46 void CreateMonitorService(Kernel::HLERequestContext& ctx) {
47 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
48 rb.Push(RESULT_SUCCESS);
49 rb.PushIpcInterface<IMonitorService>();
50
51 LOG_DEBUG(Service_LDN, "called");
52 }
53};
54
55class ILocalCommunicationService final : public ServiceFramework<ILocalCommunicationService> {
56public:
57 explicit ILocalCommunicationService(const char* name) : ServiceFramework{name} {
58 // clang-format off
59 static const FunctionInfo functions[] = {
60 {0, nullptr, "GetState"},
61 {1, nullptr, "GetNetworkInfo"},
62 {2, nullptr, "GetIpv4Address"},
63 {3, nullptr, "GetDisconnectReason"},
64 {4, nullptr, "GetSecurityParameter"},
65 {5, nullptr, "GetNetworkConfig"},
66 {100, nullptr, "AttachStateChangeEvent"},
67 {101, nullptr, "GetNetworkInfoLatestUpdate"},
68 {102, nullptr, "Scan"},
69 {103, nullptr, "ScanPrivate"},
70 {200, nullptr, "OpenAccessPoint"},
71 {201, nullptr, "CloseAccessPoint"},
72 {202, nullptr, "CreateNetwork"},
73 {203, nullptr, "CreateNetworkPrivate"},
74 {204, nullptr, "DestroyNetwork"},
75 {205, nullptr, "Reject"},
76 {206, nullptr, "SetAdvertiseData"},
77 {207, nullptr, "SetStationAcceptPolicy"},
78 {208, nullptr, "AddAcceptFilterEntry"},
79 {209, nullptr, "ClearAcceptFilter"},
80 {300, nullptr, "OpenStation"},
81 {301, nullptr, "CloseStation"},
82 {302, nullptr, "Connect"},
83 {303, nullptr, "ConnectPrivate"},
84 {304, nullptr, "Disconnect"},
85 {400, nullptr, "InitializeSystem"},
86 {401, nullptr, "FinalizeSystem"},
87 };
88 // clang-format on
89
90 RegisterHandlers(functions);
91 }
92};
93
94class LDNS final : public ServiceFramework<LDNS> {
95public:
96 explicit LDNS() : ServiceFramework{"ldn:s"} {
97 // clang-format off
98 static const FunctionInfo functions[] = {
99 {0, &LDNS::CreateSystemLocalCommunicationService, "CreateSystemLocalCommunicationService"},
100 };
101 // clang-format on
102
103 RegisterHandlers(functions);
104 }
105
106 void CreateSystemLocalCommunicationService(Kernel::HLERequestContext& ctx) {
107 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
108 rb.Push(RESULT_SUCCESS);
109 rb.PushIpcInterface<ILocalCommunicationService>("ISystemLocalCommunicationService");
110
111 LOG_DEBUG(Service_LDN, "called");
112 }
113};
114
115class LDNU final : public ServiceFramework<LDNU> {
116public:
117 explicit LDNU() : ServiceFramework{"ldn:u"} {
118 // clang-format off
119 static const FunctionInfo functions[] = {
120 {0, &LDNU::CreateUserLocalCommunicationService, "CreateUserLocalCommunicationService"},
121 };
122 // clang-format on
123
124 RegisterHandlers(functions);
125 }
126
127 void CreateUserLocalCommunicationService(Kernel::HLERequestContext& ctx) {
128 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
129 rb.Push(RESULT_SUCCESS);
130 rb.PushIpcInterface<ILocalCommunicationService>("IUserLocalCommunicationService");
131
132 LOG_DEBUG(Service_LDN, "called");
133 }
134};
135
136void InstallInterfaces(SM::ServiceManager& sm) {
137 std::make_shared<LDNM>()->InstallAsService(sm);
138 std::make_shared<LDNS>()->InstallAsService(sm);
139 std::make_shared<LDNU>()->InstallAsService(sm);
140}
141
142} // namespace Service::LDN
diff --git a/src/core/hle/service/ldn/ldn.h b/src/core/hle/service/ldn/ldn.h
new file mode 100644
index 000000000..6b2a3c2b2
--- /dev/null
+++ b/src/core/hle/service/ldn/ldn.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::LDN {
12
13/// Registers all LDN services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::LDN
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index e85a8bdb9..b497376d7 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -4,10 +4,12 @@
4 4
5#include <sstream> 5#include <sstream>
6#include <string> 6#include <string>
7
7#include "common/logging/log.h" 8#include "common/logging/log.h"
8#include "core/hle/ipc_helpers.h" 9#include "core/hle/ipc_helpers.h"
9#include "core/hle/kernel/client_session.h"
10#include "core/hle/service/lm/lm.h" 10#include "core/hle/service/lm/lm.h"
11#include "core/hle/service/service.h"
12#include "core/memory.h"
11 13
12namespace Service::LM { 14namespace Service::LM {
13 15
@@ -15,13 +17,12 @@ class Logger final : public ServiceFramework<Logger> {
15public: 17public:
16 Logger() : ServiceFramework("Logger") { 18 Logger() : ServiceFramework("Logger") {
17 static const FunctionInfo functions[] = { 19 static const FunctionInfo functions[] = {
18 {0x00000000, &Logger::Log, "Log"}, 20 {0x00000000, &Logger::Initialize, "Initialize"},
21 {0x00000001, nullptr, "SetDestination"},
19 }; 22 };
20 RegisterHandlers(functions); 23 RegisterHandlers(functions);
21 } 24 }
22 25
23 ~Logger() = default;
24
25private: 26private:
26 struct MessageHeader { 27 struct MessageHeader {
27 enum Flags : u32_le { 28 enum Flags : u32_le {
@@ -66,13 +67,13 @@ private:
66 }; 67 };
67 68
68 /** 69 /**
69 * LM::Log service function 70 * ILogger::Initialize service function
70 * Inputs: 71 * Inputs:
71 * 0: 0x00000000 72 * 0: 0x00000000
72 * Outputs: 73 * Outputs:
73 * 0: ResultCode 74 * 0: ResultCode
74 */ 75 */
75 void Log(Kernel::HLERequestContext& ctx) { 76 void Initialize(Kernel::HLERequestContext& ctx) {
76 // This function only succeeds - Get that out of the way 77 // This function only succeeds - Get that out of the way
77 IPC::ResponseBuilder rb{ctx, 2}; 78 IPC::ResponseBuilder rb{ctx, 2};
78 rb.Push(RESULT_SUCCESS); 79 rb.Push(RESULT_SUCCESS);
@@ -162,30 +163,33 @@ private:
162 std::ostringstream log_stream; 163 std::ostringstream log_stream;
163}; 164};
164 165
165void InstallInterfaces(SM::ServiceManager& service_manager) { 166class LM final : public ServiceFramework<LM> {
166 std::make_shared<LM>()->InstallAsService(service_manager); 167public:
167} 168 explicit LM() : ServiceFramework{"lm"} {
169 static const FunctionInfo functions[] = {
170 {0x00000000, &LM::OpenLogger, "OpenLogger"},
171 };
172 RegisterHandlers(functions);
173 }
168 174
169/** 175 /**
170 * LM::Initialize service function 176 * LM::OpenLogger service function
171 * Inputs: 177 * Inputs:
172 * 0: 0x00000000 178 * 0: 0x00000000
173 * Outputs: 179 * Outputs:
174 * 0: ResultCode 180 * 0: ResultCode
175 */ 181 */
176void LM::Initialize(Kernel::HLERequestContext& ctx) { 182 void OpenLogger(Kernel::HLERequestContext& ctx) {
177 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 183 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
178 rb.Push(RESULT_SUCCESS); 184 rb.Push(RESULT_SUCCESS);
179 rb.PushIpcInterface<Logger>(); 185 rb.PushIpcInterface<Logger>();
180
181 LOG_DEBUG(Service_LM, "called");
182}
183 186
184LM::LM() : ServiceFramework("lm") { 187 LOG_DEBUG(Service_LM, "called");
185 static const FunctionInfo functions[] = { 188 }
186 {0x00000000, &LM::Initialize, "Initialize"}, 189};
187 }; 190
188 RegisterHandlers(functions); 191void InstallInterfaces(SM::ServiceManager& service_manager) {
192 std::make_shared<LM>()->InstallAsService(service_manager);
189} 193}
190 194
191} // namespace Service::LM 195} // namespace Service::LM
diff --git a/src/core/hle/service/lm/lm.h b/src/core/hle/service/lm/lm.h
index 63d6506fe..7806ae27b 100644
--- a/src/core/hle/service/lm/lm.h
+++ b/src/core/hle/service/lm/lm.h
@@ -4,21 +4,12 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <vector> 7namespace Service::SM {
8#include "core/hle/kernel/kernel.h" 8class ServiceManager;
9#include "core/hle/service/service.h" 9}
10 10
11namespace Service::LM { 11namespace Service::LM {
12 12
13class LM final : public ServiceFramework<LM> {
14public:
15 LM();
16 ~LM() = default;
17
18private:
19 void Initialize(Kernel::HLERequestContext& ctx);
20};
21
22/// Registers all LM services with the specified service manager. 13/// Registers all LM services with the specified service manager.
23void InstallInterfaces(SM::ServiceManager& service_manager); 14void InstallInterfaces(SM::ServiceManager& service_manager);
24 15
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index f35828967..e167ea827 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -28,6 +28,7 @@
28#include "core/hle/service/filesystem/filesystem.h" 28#include "core/hle/service/filesystem/filesystem.h"
29#include "core/hle/service/friend/friend.h" 29#include "core/hle/service/friend/friend.h"
30#include "core/hle/service/hid/hid.h" 30#include "core/hle/service/hid/hid.h"
31#include "core/hle/service/ldn/ldn.h"
31#include "core/hle/service/ldr/ldr.h" 32#include "core/hle/service/ldr/ldr.h"
32#include "core/hle/service/lm/lm.h" 33#include "core/hle/service/lm/lm.h"
33#include "core/hle/service/mm/mm_u.h" 34#include "core/hle/service/mm/mm_u.h"
@@ -200,6 +201,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
200 FileSystem::InstallInterfaces(*sm); 201 FileSystem::InstallInterfaces(*sm);
201 Friend::InstallInterfaces(*sm); 202 Friend::InstallInterfaces(*sm);
202 HID::InstallInterfaces(*sm); 203 HID::InstallInterfaces(*sm);
204 LDN::InstallInterfaces(*sm);
203 LDR::InstallInterfaces(*sm); 205 LDR::InstallInterfaces(*sm);
204 LM::InstallInterfaces(*sm); 206 LM::InstallInterfaces(*sm);
205 MM::InstallInterfaces(*sm); 207 MM::InstallInterfaces(*sm);
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index 6aa1e2511..3211a8346 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -109,4 +109,26 @@ BSD::BSD(const char* name) : ServiceFramework(name) {
109 RegisterHandlers(functions); 109 RegisterHandlers(functions);
110} 110}
111 111
112BSDCFG::BSDCFG() : ServiceFramework{"bsdcfg"} {
113 // clang-format off
114 static const FunctionInfo functions[] = {
115 {0, nullptr, "SetIfUp"},
116 {1, nullptr, "SetIfUpWithEvent"},
117 {2, nullptr, "CancelIf"},
118 {3, nullptr, "SetIfDown"},
119 {4, nullptr, "GetIfState"},
120 {5, nullptr, "DhcpRenew"},
121 {6, nullptr, "AddStaticArpEntry"},
122 {7, nullptr, "RemoveArpEntry"},
123 {8, nullptr, "LookupArpEntry"},
124 {9, nullptr, "LookupArpEntry2"},
125 {10, nullptr, "ClearArpEntries"},
126 {11, nullptr, "ClearArpEntries2"},
127 {12, nullptr, "PrintArpEntries"},
128 };
129 // clang-format on
130
131 RegisterHandlers(functions);
132}
133
112} // namespace Service::Sockets 134} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h
index a6b1ca7d0..c1da59b24 100644
--- a/src/core/hle/service/sockets/bsd.h
+++ b/src/core/hle/service/sockets/bsd.h
@@ -26,4 +26,9 @@ private:
26 u32 next_fd = 1; 26 u32 next_fd = 1;
27}; 27};
28 28
29class BSDCFG final : public ServiceFramework<BSDCFG> {
30public:
31 explicit BSDCFG();
32};
33
29} // namespace Service::Sockets 34} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/ethc.cpp b/src/core/hle/service/sockets/ethc.cpp
new file mode 100644
index 000000000..d53c25eec
--- /dev/null
+++ b/src/core/hle/service/sockets/ethc.cpp
@@ -0,0 +1,38 @@
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/sockets/ethc.h"
6
7namespace Service::Sockets {
8
9ETHC_C::ETHC_C() : ServiceFramework{"ethc:c"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "Initialize"},
13 {1, nullptr, "Cancel"},
14 {2, nullptr, "GetResult"},
15 {3, nullptr, "GetMediaList"},
16 {4, nullptr, "SetMediaType"},
17 {5, nullptr, "GetMediaType"},
18 };
19 // clang-format on
20
21 RegisterHandlers(functions);
22}
23
24ETHC_I::ETHC_I() : ServiceFramework{"ethc:i"} {
25 // clang-format off
26 static const FunctionInfo functions[] = {
27 {0, nullptr, "GetReadableHandle"},
28 {1, nullptr, "Cancel"},
29 {2, nullptr, "GetResult"},
30 {3, nullptr, "GetInterfaceList"},
31 {4, nullptr, "GetInterfaceCount"},
32 };
33 // clang-format on
34
35 RegisterHandlers(functions);
36}
37
38} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/ethc.h b/src/core/hle/service/sockets/ethc.h
new file mode 100644
index 000000000..9a3c88100
--- /dev/null
+++ b/src/core/hle/service/sockets/ethc.h
@@ -0,0 +1,21 @@
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/service.h"
8
9namespace Service::Sockets {
10
11class ETHC_C final : public ServiceFramework<ETHC_C> {
12public:
13 explicit ETHC_C();
14};
15
16class ETHC_I final : public ServiceFramework<ETHC_I> {
17public:
18 explicit ETHC_I();
19};
20
21} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp
index 05bd10d35..08d2d306a 100644
--- a/src/core/hle/service/sockets/sockets.cpp
+++ b/src/core/hle/service/sockets/sockets.cpp
@@ -3,6 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/sockets/bsd.h" 5#include "core/hle/service/sockets/bsd.h"
6#include "core/hle/service/sockets/ethc.h"
6#include "core/hle/service/sockets/nsd.h" 7#include "core/hle/service/sockets/nsd.h"
7#include "core/hle/service/sockets/sfdnsres.h" 8#include "core/hle/service/sockets/sfdnsres.h"
8#include "core/hle/service/sockets/sockets.h" 9#include "core/hle/service/sockets/sockets.h"
@@ -12,8 +13,14 @@ namespace Service::Sockets {
12void InstallInterfaces(SM::ServiceManager& service_manager) { 13void InstallInterfaces(SM::ServiceManager& service_manager) {
13 std::make_shared<BSD>("bsd:s")->InstallAsService(service_manager); 14 std::make_shared<BSD>("bsd:s")->InstallAsService(service_manager);
14 std::make_shared<BSD>("bsd:u")->InstallAsService(service_manager); 15 std::make_shared<BSD>("bsd:u")->InstallAsService(service_manager);
16 std::make_shared<BSDCFG>()->InstallAsService(service_manager);
17
18 std::make_shared<ETHC_C>()->InstallAsService(service_manager);
19 std::make_shared<ETHC_I>()->InstallAsService(service_manager);
20
15 std::make_shared<NSD>("nsd:a")->InstallAsService(service_manager); 21 std::make_shared<NSD>("nsd:a")->InstallAsService(service_manager);
16 std::make_shared<NSD>("nsd:u")->InstallAsService(service_manager); 22 std::make_shared<NSD>("nsd:u")->InstallAsService(service_manager);
23
17 std::make_shared<SFDNSRES>()->InstallAsService(service_manager); 24 std::make_shared<SFDNSRES>()->InstallAsService(service_manager);
18} 25}
19 26
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index e9d87efb4..c464fc6d1 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -23,7 +23,13 @@ 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,
32 R16_FLOAT = 0xF2,
27 R8_UNORM = 0xF3, 33 R8_UNORM = 0xF3,
28}; 34};
29 35
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index 2f814a184..ca923d17d 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -13,8 +13,10 @@ GPUVAddr MemoryManager::AllocateSpace(u64 size, u64 align) {
13 ASSERT(gpu_addr); 13 ASSERT(gpu_addr);
14 14
15 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 15 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
16 ASSERT(PageSlot(*gpu_addr + offset) == static_cast<u64>(PageStatus::Unmapped)); 16 VAddr& slot = PageSlot(*gpu_addr + offset);
17 PageSlot(*gpu_addr + offset) = static_cast<u64>(PageStatus::Allocated); 17
18 ASSERT(slot == static_cast<u64>(PageStatus::Unmapped));
19 slot = static_cast<u64>(PageStatus::Allocated);
18 } 20 }
19 21
20 return *gpu_addr; 22 return *gpu_addr;
@@ -22,8 +24,10 @@ GPUVAddr MemoryManager::AllocateSpace(u64 size, u64 align) {
22 24
23GPUVAddr MemoryManager::AllocateSpace(GPUVAddr gpu_addr, u64 size, u64 align) { 25GPUVAddr MemoryManager::AllocateSpace(GPUVAddr gpu_addr, u64 size, u64 align) {
24 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 26 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
25 ASSERT(PageSlot(gpu_addr + offset) == static_cast<u64>(PageStatus::Unmapped)); 27 VAddr& slot = PageSlot(gpu_addr + offset);
26 PageSlot(gpu_addr + offset) = static_cast<u64>(PageStatus::Allocated); 28
29 ASSERT(slot == static_cast<u64>(PageStatus::Unmapped));
30 slot = static_cast<u64>(PageStatus::Allocated);
27 } 31 }
28 32
29 return gpu_addr; 33 return gpu_addr;
@@ -34,8 +38,10 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, u64 size) {
34 ASSERT(gpu_addr); 38 ASSERT(gpu_addr);
35 39
36 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 40 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
37 ASSERT(PageSlot(*gpu_addr + offset) == static_cast<u64>(PageStatus::Unmapped)); 41 VAddr& slot = PageSlot(*gpu_addr + offset);
38 PageSlot(*gpu_addr + offset) = cpu_addr + offset; 42
43 ASSERT(slot == static_cast<u64>(PageStatus::Unmapped));
44 slot = cpu_addr + offset;
39 } 45 }
40 46
41 MappedRegion region{cpu_addr, *gpu_addr, size}; 47 MappedRegion region{cpu_addr, *gpu_addr, size};
@@ -48,8 +54,10 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, GPUVAddr gpu_addr, u64 size)
48 ASSERT((gpu_addr & PAGE_MASK) == 0); 54 ASSERT((gpu_addr & PAGE_MASK) == 0);
49 55
50 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 56 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
51 ASSERT(PageSlot(gpu_addr + offset) == static_cast<u64>(PageStatus::Allocated)); 57 VAddr& slot = PageSlot(gpu_addr + offset);
52 PageSlot(gpu_addr + offset) = cpu_addr + offset; 58
59 ASSERT(slot == static_cast<u64>(PageStatus::Allocated));
60 slot = cpu_addr + offset;
53 } 61 }
54 62
55 MappedRegion region{cpu_addr, gpu_addr, size}; 63 MappedRegion region{cpu_addr, gpu_addr, size};
@@ -62,9 +70,11 @@ GPUVAddr MemoryManager::UnmapBuffer(GPUVAddr gpu_addr, u64 size) {
62 ASSERT((gpu_addr & PAGE_MASK) == 0); 70 ASSERT((gpu_addr & PAGE_MASK) == 0);
63 71
64 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 72 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
65 ASSERT(PageSlot(gpu_addr + offset) != static_cast<u64>(PageStatus::Allocated) && 73 VAddr& slot = PageSlot(gpu_addr + offset);
66 PageSlot(gpu_addr + offset) != static_cast<u64>(PageStatus::Unmapped)); 74
67 PageSlot(gpu_addr + offset) = static_cast<u64>(PageStatus::Unmapped); 75 ASSERT(slot != static_cast<u64>(PageStatus::Allocated) &&
76 slot != static_cast<u64>(PageStatus::Unmapped));
77 slot = static_cast<u64>(PageStatus::Unmapped);
68 } 78 }
69 79
70 // Delete the region mappings that are contained within the unmapped region 80 // Delete the region mappings that are contained within the unmapped region
@@ -128,9 +138,7 @@ VAddr& MemoryManager::PageSlot(GPUVAddr gpu_addr) {
128 auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK]; 138 auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK];
129 if (!block) { 139 if (!block) {
130 block = std::make_unique<PageBlock>(); 140 block = std::make_unique<PageBlock>();
131 for (unsigned index = 0; index < PAGE_BLOCK_SIZE; index++) { 141 block->fill(static_cast<VAddr>(PageStatus::Unmapped));
132 (*block)[index] = static_cast<u64>(PageStatus::Unmapped);
133 }
134 } 142 }
135 return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK]; 143 return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK];
136} 144}
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..bf0458b94 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,18 @@ 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 case Tegra::RenderTargetFormat::R16_FLOAT:
234 return PixelFormat::R16F;
208 default: 235 default:
209 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 236 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
210 UNREACHABLE(); 237 UNREACHABLE();
@@ -271,6 +298,22 @@ struct SurfaceParams {
271 return PixelFormat::BC7U; 298 return PixelFormat::BC7U;
272 case Tegra::Texture::TextureFormat::ASTC_2D_4X4: 299 case Tegra::Texture::TextureFormat::ASTC_2D_4X4:
273 return PixelFormat::ASTC_2D_4X4; 300 return PixelFormat::ASTC_2D_4X4;
301 case Tegra::Texture::TextureFormat::R16_G16:
302 switch (component_type) {
303 case Tegra::Texture::ComponentType::FLOAT:
304 return PixelFormat::RG16F;
305 case Tegra::Texture::ComponentType::UNORM:
306 return PixelFormat::RG16;
307 case Tegra::Texture::ComponentType::SNORM:
308 return PixelFormat::RG16S;
309 case Tegra::Texture::ComponentType::UINT:
310 return PixelFormat::RG16UI;
311 case Tegra::Texture::ComponentType::SINT:
312 return PixelFormat::RG16I;
313 }
314 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}",
315 static_cast<u32>(component_type));
316 UNREACHABLE();
274 default: 317 default:
275 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", 318 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}",
276 static_cast<u32>(format), static_cast<u32>(component_type)); 319 static_cast<u32>(format), static_cast<u32>(component_type));
@@ -329,6 +372,12 @@ struct SurfaceParams {
329 return Tegra::Texture::TextureFormat::ZF32; 372 return Tegra::Texture::TextureFormat::ZF32;
330 case PixelFormat::Z24S8: 373 case PixelFormat::Z24S8:
331 return Tegra::Texture::TextureFormat::Z24S8; 374 return Tegra::Texture::TextureFormat::Z24S8;
375 case PixelFormat::RG16F:
376 case PixelFormat::RG16:
377 case PixelFormat::RG16UI:
378 case PixelFormat::RG16I:
379 case PixelFormat::RG16S:
380 return Tegra::Texture::TextureFormat::R16_G16;
332 default: 381 default:
333 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 382 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
334 UNREACHABLE(); 383 UNREACHABLE();
@@ -360,6 +409,12 @@ struct SurfaceParams {
360 return ComponentType::UNorm; 409 return ComponentType::UNorm;
361 case Tegra::Texture::ComponentType::FLOAT: 410 case Tegra::Texture::ComponentType::FLOAT:
362 return ComponentType::Float; 411 return ComponentType::Float;
412 case Tegra::Texture::ComponentType::SNORM:
413 return ComponentType::SNorm;
414 case Tegra::Texture::ComponentType::UINT:
415 return ComponentType::UInt;
416 case Tegra::Texture::ComponentType::SINT:
417 return ComponentType::SInt;
363 default: 418 default:
364 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type)); 419 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
365 UNREACHABLE(); 420 UNREACHABLE();
@@ -374,14 +429,22 @@ struct SurfaceParams {
374 case Tegra::RenderTargetFormat::BGRA8_UNORM: 429 case Tegra::RenderTargetFormat::BGRA8_UNORM:
375 case Tegra::RenderTargetFormat::RGB10_A2_UNORM: 430 case Tegra::RenderTargetFormat::RGB10_A2_UNORM:
376 case Tegra::RenderTargetFormat::R8_UNORM: 431 case Tegra::RenderTargetFormat::R8_UNORM:
432 case Tegra::RenderTargetFormat::RG16_UNORM:
377 return ComponentType::UNorm; 433 return ComponentType::UNorm;
434 case Tegra::RenderTargetFormat::RG16_SNORM:
435 return ComponentType::SNorm;
378 case Tegra::RenderTargetFormat::RGBA16_FLOAT: 436 case Tegra::RenderTargetFormat::RGBA16_FLOAT:
379 case Tegra::RenderTargetFormat::R11G11B10_FLOAT: 437 case Tegra::RenderTargetFormat::R11G11B10_FLOAT:
380 case Tegra::RenderTargetFormat::RGBA32_FLOAT: 438 case Tegra::RenderTargetFormat::RGBA32_FLOAT:
381 case Tegra::RenderTargetFormat::RG32_FLOAT: 439 case Tegra::RenderTargetFormat::RG32_FLOAT:
440 case Tegra::RenderTargetFormat::RG16_FLOAT:
441 case Tegra::RenderTargetFormat::R16_FLOAT:
382 return ComponentType::Float; 442 return ComponentType::Float;
383 case Tegra::RenderTargetFormat::RGBA32_UINT: 443 case Tegra::RenderTargetFormat::RGBA32_UINT:
444 case Tegra::RenderTargetFormat::RG16_UINT:
384 return ComponentType::UInt; 445 return ComponentType::UInt;
446 case Tegra::RenderTargetFormat::RG16_SINT:
447 return ComponentType::SInt;
385 default: 448 default:
386 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 449 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
387 UNREACHABLE(); 450 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;