summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorGravatar Morph2022-02-02 16:04:26 -0500
committerGravatar GitHub2022-02-02 16:04:26 -0500
commitd68eb751c53df785f842d56983ce4dfbb89aae3f (patch)
tree510752a162e2bbb0e0f5a1e60b499aa4dca0493e /src/video_core
parentMerge pull request #7834 from german77/repeat (diff)
parentcommon_types: Remove NonCopyable struct (diff)
downloadyuzu-d68eb751c53df785f842d56983ce4dfbb89aae3f.tar.gz
yuzu-d68eb751c53df785f842d56983ce4dfbb89aae3f.tar.xz
yuzu-d68eb751c53df785f842d56983ce4dfbb89aae3f.zip
Merge pull request #7838 from lioncash/noncopy
common_types: Remove NonCopyable struct
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_base.h8
-rw-r--r--src/video_core/renderer_opengl/gl_resource_manager.h50
2 files changed, 43 insertions, 15 deletions
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h
index bb204454e..c5f974080 100644
--- a/src/video_core/renderer_base.h
+++ b/src/video_core/renderer_base.h
@@ -5,9 +5,10 @@
5#pragma once 5#pragma once
6 6
7#include <atomic> 7#include <atomic>
8#include <functional>
8#include <memory> 9#include <memory>
9#include <optional>
10 10
11#include "common/common_funcs.h"
11#include "common/common_types.h" 12#include "common/common_types.h"
12#include "core/frontend/emu_window.h" 13#include "core/frontend/emu_window.h"
13#include "video_core/gpu.h" 14#include "video_core/gpu.h"
@@ -28,8 +29,11 @@ struct RendererSettings {
28 Layout::FramebufferLayout screenshot_framebuffer_layout; 29 Layout::FramebufferLayout screenshot_framebuffer_layout;
29}; 30};
30 31
31class RendererBase : NonCopyable { 32class RendererBase {
32public: 33public:
34 YUZU_NON_COPYABLE(RendererBase);
35 YUZU_NON_MOVEABLE(RendererBase);
36
33 explicit RendererBase(Core::Frontend::EmuWindow& window, 37 explicit RendererBase(Core::Frontend::EmuWindow& window,
34 std::unique_ptr<Core::Frontend::GraphicsContext> context); 38 std::unique_ptr<Core::Frontend::GraphicsContext> context);
35 virtual ~RendererBase(); 39 virtual ~RendererBase();
diff --git a/src/video_core/renderer_opengl/gl_resource_manager.h b/src/video_core/renderer_opengl/gl_resource_manager.h
index b2d5bfd3b..84e07f8bd 100644
--- a/src/video_core/renderer_opengl/gl_resource_manager.h
+++ b/src/video_core/renderer_opengl/gl_resource_manager.h
@@ -7,12 +7,14 @@
7#include <string_view> 7#include <string_view>
8#include <utility> 8#include <utility>
9#include <glad/glad.h> 9#include <glad/glad.h>
10#include "common/common_types.h" 10#include "common/common_funcs.h"
11 11
12namespace OpenGL { 12namespace OpenGL {
13 13
14class OGLRenderbuffer : private NonCopyable { 14class OGLRenderbuffer final {
15public: 15public:
16 YUZU_NON_COPYABLE(OGLRenderbuffer);
17
16 OGLRenderbuffer() = default; 18 OGLRenderbuffer() = default;
17 19
18 OGLRenderbuffer(OGLRenderbuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 20 OGLRenderbuffer(OGLRenderbuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -36,8 +38,10 @@ public:
36 GLuint handle = 0; 38 GLuint handle = 0;
37}; 39};
38 40
39class OGLTexture : private NonCopyable { 41class OGLTexture final {
40public: 42public:
43 YUZU_NON_COPYABLE(OGLTexture);
44
41 OGLTexture() = default; 45 OGLTexture() = default;
42 46
43 OGLTexture(OGLTexture&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 47 OGLTexture(OGLTexture&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -61,8 +65,10 @@ public:
61 GLuint handle = 0; 65 GLuint handle = 0;
62}; 66};
63 67
64class OGLTextureView : private NonCopyable { 68class OGLTextureView final {
65public: 69public:
70 YUZU_NON_COPYABLE(OGLTextureView);
71
66 OGLTextureView() = default; 72 OGLTextureView() = default;
67 73
68 OGLTextureView(OGLTextureView&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 74 OGLTextureView(OGLTextureView&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -86,8 +92,10 @@ public:
86 GLuint handle = 0; 92 GLuint handle = 0;
87}; 93};
88 94
89class OGLSampler : private NonCopyable { 95class OGLSampler final {
90public: 96public:
97 YUZU_NON_COPYABLE(OGLSampler);
98
91 OGLSampler() = default; 99 OGLSampler() = default;
92 100
93 OGLSampler(OGLSampler&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 101 OGLSampler(OGLSampler&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -111,8 +119,10 @@ public:
111 GLuint handle = 0; 119 GLuint handle = 0;
112}; 120};
113 121
114class OGLShader : private NonCopyable { 122class OGLShader final {
115public: 123public:
124 YUZU_NON_COPYABLE(OGLShader);
125
116 OGLShader() = default; 126 OGLShader() = default;
117 127
118 OGLShader(OGLShader&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 128 OGLShader(OGLShader&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -132,8 +142,10 @@ public:
132 GLuint handle = 0; 142 GLuint handle = 0;
133}; 143};
134 144
135class OGLProgram : private NonCopyable { 145class OGLProgram final {
136public: 146public:
147 YUZU_NON_COPYABLE(OGLProgram);
148
137 OGLProgram() = default; 149 OGLProgram() = default;
138 150
139 OGLProgram(OGLProgram&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 151 OGLProgram(OGLProgram&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -154,8 +166,10 @@ public:
154 GLuint handle = 0; 166 GLuint handle = 0;
155}; 167};
156 168
157class OGLAssemblyProgram : private NonCopyable { 169class OGLAssemblyProgram final {
158public: 170public:
171 YUZU_NON_COPYABLE(OGLAssemblyProgram);
172
159 OGLAssemblyProgram() = default; 173 OGLAssemblyProgram() = default;
160 174
161 OGLAssemblyProgram(OGLAssemblyProgram&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 175 OGLAssemblyProgram(OGLAssemblyProgram&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -176,8 +190,10 @@ public:
176 GLuint handle = 0; 190 GLuint handle = 0;
177}; 191};
178 192
179class OGLPipeline : private NonCopyable { 193class OGLPipeline final {
180public: 194public:
195 YUZU_NON_COPYABLE(OGLPipeline);
196
181 OGLPipeline() = default; 197 OGLPipeline() = default;
182 OGLPipeline(OGLPipeline&& o) noexcept : handle{std::exchange<GLuint>(o.handle, 0)} {} 198 OGLPipeline(OGLPipeline&& o) noexcept : handle{std::exchange<GLuint>(o.handle, 0)} {}
183 199
@@ -198,8 +214,10 @@ public:
198 GLuint handle = 0; 214 GLuint handle = 0;
199}; 215};
200 216
201class OGLBuffer : private NonCopyable { 217class OGLBuffer final {
202public: 218public:
219 YUZU_NON_COPYABLE(OGLBuffer);
220
203 OGLBuffer() = default; 221 OGLBuffer() = default;
204 222
205 OGLBuffer(OGLBuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 223 OGLBuffer(OGLBuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -223,8 +241,10 @@ public:
223 GLuint handle = 0; 241 GLuint handle = 0;
224}; 242};
225 243
226class OGLSync : private NonCopyable { 244class OGLSync final {
227public: 245public:
246 YUZU_NON_COPYABLE(OGLSync);
247
228 OGLSync() = default; 248 OGLSync() = default;
229 249
230 OGLSync(OGLSync&& o) noexcept : handle(std::exchange(o.handle, nullptr)) {} 250 OGLSync(OGLSync&& o) noexcept : handle(std::exchange(o.handle, nullptr)) {}
@@ -247,8 +267,10 @@ public:
247 GLsync handle = 0; 267 GLsync handle = 0;
248}; 268};
249 269
250class OGLFramebuffer : private NonCopyable { 270class OGLFramebuffer final {
251public: 271public:
272 YUZU_NON_COPYABLE(OGLFramebuffer);
273
252 OGLFramebuffer() = default; 274 OGLFramebuffer() = default;
253 275
254 OGLFramebuffer(OGLFramebuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 276 OGLFramebuffer(OGLFramebuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {}
@@ -272,8 +294,10 @@ public:
272 GLuint handle = 0; 294 GLuint handle = 0;
273}; 295};
274 296
275class OGLQuery : private NonCopyable { 297class OGLQuery final {
276public: 298public:
299 YUZU_NON_COPYABLE(OGLQuery);
300
277 OGLQuery() = default; 301 OGLQuery() = default;
278 302
279 OGLQuery(OGLQuery&& o) noexcept : handle(std::exchange(o.handle, 0)) {} 303 OGLQuery(OGLQuery&& o) noexcept : handle(std::exchange(o.handle, 0)) {}