diff options
| author | 2022-02-02 16:04:26 -0500 | |
|---|---|---|
| committer | 2022-02-02 16:04:26 -0500 | |
| commit | d68eb751c53df785f842d56983ce4dfbb89aae3f (patch) | |
| tree | 510752a162e2bbb0e0f5a1e60b499aa4dca0493e /src/video_core | |
| parent | Merge pull request #7834 from german77/repeat (diff) | |
| parent | common_types: Remove NonCopyable struct (diff) | |
| download | yuzu-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.h | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_resource_manager.h | 50 |
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 | ||
| 31 | class RendererBase : NonCopyable { | 32 | class RendererBase { |
| 32 | public: | 33 | public: |
| 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 | ||
| 12 | namespace OpenGL { | 12 | namespace OpenGL { |
| 13 | 13 | ||
| 14 | class OGLRenderbuffer : private NonCopyable { | 14 | class OGLRenderbuffer final { |
| 15 | public: | 15 | public: |
| 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 | ||
| 39 | class OGLTexture : private NonCopyable { | 41 | class OGLTexture final { |
| 40 | public: | 42 | public: |
| 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 | ||
| 64 | class OGLTextureView : private NonCopyable { | 68 | class OGLTextureView final { |
| 65 | public: | 69 | public: |
| 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 | ||
| 89 | class OGLSampler : private NonCopyable { | 95 | class OGLSampler final { |
| 90 | public: | 96 | public: |
| 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 | ||
| 114 | class OGLShader : private NonCopyable { | 122 | class OGLShader final { |
| 115 | public: | 123 | public: |
| 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 | ||
| 135 | class OGLProgram : private NonCopyable { | 145 | class OGLProgram final { |
| 136 | public: | 146 | public: |
| 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 | ||
| 157 | class OGLAssemblyProgram : private NonCopyable { | 169 | class OGLAssemblyProgram final { |
| 158 | public: | 170 | public: |
| 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 | ||
| 179 | class OGLPipeline : private NonCopyable { | 193 | class OGLPipeline final { |
| 180 | public: | 194 | public: |
| 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 | ||
| 201 | class OGLBuffer : private NonCopyable { | 217 | class OGLBuffer final { |
| 202 | public: | 218 | public: |
| 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 | ||
| 226 | class OGLSync : private NonCopyable { | 244 | class OGLSync final { |
| 227 | public: | 245 | public: |
| 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 | ||
| 250 | class OGLFramebuffer : private NonCopyable { | 270 | class OGLFramebuffer final { |
| 251 | public: | 271 | public: |
| 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 | ||
| 275 | class OGLQuery : private NonCopyable { | 297 | class OGLQuery final { |
| 276 | public: | 298 | public: |
| 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)) {} |