diff options
| author | 2018-08-22 18:14:48 -0400 | |
|---|---|---|
| committer | 2018-08-22 18:14:48 -0400 | |
| commit | c5ea6db02d82a7594de68faf9bfda795cdc6f90d (patch) | |
| tree | ad147bd54fba2ee1eb0b45f0ecfbedc9197cf52a /src/video_core | |
| parent | Merge pull request #1158 from lioncash/boost (diff) | |
| parent | renderer_opengl: Namespace OpenGL code (diff) | |
| download | yuzu-c5ea6db02d82a7594de68faf9bfda795cdc6f90d.tar.gz yuzu-c5ea6db02d82a7594de68faf9bfda795cdc6f90d.tar.xz yuzu-c5ea6db02d82a7594de68faf9bfda795cdc6f90d.zip | |
Merge pull request #1137 from lioncash/namespace
renderer_opengl: Namespace OpenGL code
Diffstat (limited to 'src/video_core')
21 files changed, 70 insertions, 23 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 35056d9bd..c67eabe65 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | #include "video_core/renderer_opengl/renderer_opengl.h" | 25 | #include "video_core/renderer_opengl/renderer_opengl.h" |
| 26 | #include "video_core/video_core.h" | 26 | #include "video_core/video_core.h" |
| 27 | 27 | ||
| 28 | namespace OpenGL { | ||
| 29 | |||
| 28 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; | 30 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; |
| 29 | using PixelFormat = SurfaceParams::PixelFormat; | 31 | using PixelFormat = SurfaceParams::PixelFormat; |
| 30 | using SurfaceType = SurfaceParams::SurfaceType; | 32 | using SurfaceType = SurfaceParams::SurfaceType; |
| @@ -874,3 +876,5 @@ void RasterizerOpenGL::SyncLogicOpState() { | |||
| 874 | 876 | ||
| 875 | state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation); | 877 | state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation); |
| 876 | } | 878 | } |
| 879 | |||
| 880 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index f40e70bf4..59b727de0 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -22,12 +22,14 @@ | |||
| 22 | #include "video_core/renderer_opengl/gl_state.h" | 22 | #include "video_core/renderer_opengl/gl_state.h" |
| 23 | #include "video_core/renderer_opengl/gl_stream_buffer.h" | 23 | #include "video_core/renderer_opengl/gl_stream_buffer.h" |
| 24 | 24 | ||
| 25 | struct ScreenInfo; | ||
| 26 | |||
| 27 | namespace Core::Frontend { | 25 | namespace Core::Frontend { |
| 28 | class EmuWindow; | 26 | class EmuWindow; |
| 29 | } | 27 | } |
| 30 | 28 | ||
| 29 | namespace OpenGL { | ||
| 30 | |||
| 31 | struct ScreenInfo; | ||
| 32 | |||
| 31 | class RasterizerOpenGL : public VideoCore::RasterizerInterface { | 33 | class RasterizerOpenGL : public VideoCore::RasterizerInterface { |
| 32 | public: | 34 | public: |
| 33 | explicit RasterizerOpenGL(Core::Frontend::EmuWindow& renderer, ScreenInfo& info); | 35 | explicit RasterizerOpenGL(Core::Frontend::EmuWindow& renderer, ScreenInfo& info); |
| @@ -184,3 +186,5 @@ private: | |||
| 184 | enum class AccelDraw { Disabled, Arrays, Indexed }; | 186 | enum class AccelDraw { Disabled, Arrays, Indexed }; |
| 185 | AccelDraw accelerate_draw = AccelDraw::Disabled; | 187 | AccelDraw accelerate_draw = AccelDraw::Disabled; |
| 186 | }; | 188 | }; |
| 189 | |||
| 190 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 817fa07a8..b1769c99b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -19,6 +19,8 @@ | |||
| 19 | #include "video_core/textures/decoders.h" | 19 | #include "video_core/textures/decoders.h" |
| 20 | #include "video_core/utils.h" | 20 | #include "video_core/utils.h" |
| 21 | 21 | ||
| 22 | namespace OpenGL { | ||
| 23 | |||
| 22 | using SurfaceType = SurfaceParams::SurfaceType; | 24 | using SurfaceType = SurfaceParams::SurfaceType; |
| 23 | using PixelFormat = SurfaceParams::PixelFormat; | 25 | using PixelFormat = SurfaceParams::PixelFormat; |
| 24 | using ComponentType = SurfaceParams::ComponentType; | 26 | using ComponentType = SurfaceParams::ComponentType; |
| @@ -967,3 +969,5 @@ void RasterizerCacheOpenGL::UpdatePagesCachedCount(Tegra::GPUVAddr addr, u64 siz | |||
| 967 | if (delta < 0) | 969 | if (delta < 0) |
| 968 | cached_pages.add({pages_interval, delta}); | 970 | cached_pages.add({pages_interval, delta}); |
| 969 | } | 971 | } |
| 972 | |||
| 973 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 907e7d606..f273152a2 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include "video_core/renderer_opengl/gl_resource_manager.h" | 16 | #include "video_core/renderer_opengl/gl_resource_manager.h" |
| 17 | #include "video_core/textures/texture.h" | 17 | #include "video_core/textures/texture.h" |
| 18 | 18 | ||
| 19 | namespace OpenGL { | ||
| 20 | |||
| 19 | class CachedSurface; | 21 | class CachedSurface; |
| 20 | using Surface = std::shared_ptr<CachedSurface>; | 22 | using Surface = std::shared_ptr<CachedSurface>; |
| 21 | using SurfaceSurfaceRect_Tuple = std::tuple<Surface, Surface, MathUtil::Rectangle<u32>>; | 23 | using SurfaceSurfaceRect_Tuple = std::tuple<Surface, Surface, MathUtil::Rectangle<u32>>; |
| @@ -759,3 +761,5 @@ private: | |||
| 759 | OGLFramebuffer read_framebuffer; | 761 | OGLFramebuffer read_framebuffer; |
| 760 | OGLFramebuffer draw_framebuffer; | 762 | OGLFramebuffer draw_framebuffer; |
| 761 | }; | 763 | }; |
| 764 | |||
| 765 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_resource_manager.h b/src/video_core/renderer_opengl/gl_resource_manager.h index 0fed93ca5..3bc1b83b5 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.h +++ b/src/video_core/renderer_opengl/gl_resource_manager.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | #include "video_core/renderer_opengl/gl_shader_util.h" | 10 | #include "video_core/renderer_opengl/gl_shader_util.h" |
| 11 | #include "video_core/renderer_opengl/gl_state.h" | 11 | #include "video_core/renderer_opengl/gl_state.h" |
| 12 | 12 | ||
| 13 | namespace OpenGL { | ||
| 14 | |||
| 13 | class OGLTexture : private NonCopyable { | 15 | class OGLTexture : private NonCopyable { |
| 14 | public: | 16 | public: |
| 15 | OGLTexture() = default; | 17 | OGLTexture() = default; |
| @@ -331,3 +333,5 @@ public: | |||
| 331 | 333 | ||
| 332 | GLuint handle = 0; | 334 | GLuint handle = 0; |
| 333 | }; | 335 | }; |
| 336 | |||
| 337 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 5b976b636..f1e00c93c 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include "video_core/renderer_opengl/gl_rasterizer.h" | 15 | #include "video_core/renderer_opengl/gl_rasterizer.h" |
| 16 | #include "video_core/renderer_opengl/gl_shader_decompiler.h" | 16 | #include "video_core/renderer_opengl/gl_shader_decompiler.h" |
| 17 | 17 | ||
| 18 | namespace GLShader::Decompiler { | 18 | namespace OpenGL::GLShader::Decompiler { |
| 19 | 19 | ||
| 20 | using Tegra::Shader::Attribute; | 20 | using Tegra::Shader::Attribute; |
| 21 | using Tegra::Shader::Instruction; | 21 | using Tegra::Shader::Instruction; |
| @@ -2176,4 +2176,4 @@ boost::optional<ProgramResult> DecompileProgram(const ProgramCode& program_code, | |||
| 2176 | return boost::none; | 2176 | return boost::none; |
| 2177 | } | 2177 | } |
| 2178 | 2178 | ||
| 2179 | } // namespace GLShader::Decompiler | 2179 | } // namespace OpenGL::GLShader::Decompiler |
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.h b/src/video_core/renderer_opengl/gl_shader_decompiler.h index df6769462..b20cc4bfa 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.h +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "video_core/engines/maxwell_3d.h" | 12 | #include "video_core/engines/maxwell_3d.h" |
| 13 | #include "video_core/renderer_opengl/gl_shader_gen.h" | 13 | #include "video_core/renderer_opengl/gl_shader_gen.h" |
| 14 | 14 | ||
| 15 | namespace GLShader::Decompiler { | 15 | namespace OpenGL::GLShader::Decompiler { |
| 16 | 16 | ||
| 17 | using Tegra::Engines::Maxwell3D; | 17 | using Tegra::Engines::Maxwell3D; |
| 18 | 18 | ||
| @@ -22,4 +22,4 @@ boost::optional<ProgramResult> DecompileProgram(const ProgramCode& program_code, | |||
| 22 | Maxwell3D::Regs::ShaderStage stage, | 22 | Maxwell3D::Regs::ShaderStage stage, |
| 23 | const std::string& suffix); | 23 | const std::string& suffix); |
| 24 | 24 | ||
| 25 | } // namespace GLShader::Decompiler | 25 | } // namespace OpenGL::GLShader::Decompiler |
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 01c7b9720..0677317bc 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "video_core/renderer_opengl/gl_shader_decompiler.h" | 7 | #include "video_core/renderer_opengl/gl_shader_decompiler.h" |
| 8 | #include "video_core/renderer_opengl/gl_shader_gen.h" | 8 | #include "video_core/renderer_opengl/gl_shader_gen.h" |
| 9 | 9 | ||
| 10 | namespace GLShader { | 10 | namespace OpenGL::GLShader { |
| 11 | 11 | ||
| 12 | using Tegra::Engines::Maxwell3D; | 12 | using Tegra::Engines::Maxwell3D; |
| 13 | 13 | ||
| @@ -103,4 +103,4 @@ void main() { | |||
| 103 | return {out, program.second}; | 103 | return {out, program.second}; |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | } // namespace GLShader | 106 | } // namespace OpenGL::GLShader |
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.h b/src/video_core/renderer_opengl/gl_shader_gen.h index 4729ce0fc..2c636b7f3 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.h +++ b/src/video_core/renderer_opengl/gl_shader_gen.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | #include "common/hash.h" | 13 | #include "common/hash.h" |
| 14 | 14 | ||
| 15 | namespace GLShader { | 15 | namespace OpenGL::GLShader { |
| 16 | 16 | ||
| 17 | constexpr size_t MAX_PROGRAM_CODE_LENGTH{0x1000}; | 17 | constexpr size_t MAX_PROGRAM_CODE_LENGTH{0x1000}; |
| 18 | 18 | ||
| @@ -191,20 +191,20 @@ ProgramResult GenerateVertexShader(const ShaderSetup& setup, const MaxwellVSConf | |||
| 191 | */ | 191 | */ |
| 192 | ProgramResult GenerateFragmentShader(const ShaderSetup& setup, const MaxwellFSConfig& config); | 192 | ProgramResult GenerateFragmentShader(const ShaderSetup& setup, const MaxwellFSConfig& config); |
| 193 | 193 | ||
| 194 | } // namespace GLShader | 194 | } // namespace OpenGL::GLShader |
| 195 | 195 | ||
| 196 | namespace std { | 196 | namespace std { |
| 197 | 197 | ||
| 198 | template <> | 198 | template <> |
| 199 | struct hash<GLShader::MaxwellVSConfig> { | 199 | struct hash<OpenGL::GLShader::MaxwellVSConfig> { |
| 200 | size_t operator()(const GLShader::MaxwellVSConfig& k) const { | 200 | size_t operator()(const OpenGL::GLShader::MaxwellVSConfig& k) const { |
| 201 | return k.Hash(); | 201 | return k.Hash(); |
| 202 | } | 202 | } |
| 203 | }; | 203 | }; |
| 204 | 204 | ||
| 205 | template <> | 205 | template <> |
| 206 | struct hash<GLShader::MaxwellFSConfig> { | 206 | struct hash<OpenGL::GLShader::MaxwellFSConfig> { |
| 207 | size_t operator()(const GLShader::MaxwellFSConfig& k) const { | 207 | size_t operator()(const OpenGL::GLShader::MaxwellFSConfig& k) const { |
| 208 | return k.Hash(); | 208 | return k.Hash(); |
| 209 | } | 209 | } |
| 210 | }; | 210 | }; |
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index f0886caac..8960afef5 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "video_core/engines/maxwell_3d.h" | 7 | #include "video_core/engines/maxwell_3d.h" |
| 8 | #include "video_core/renderer_opengl/gl_shader_manager.h" | 8 | #include "video_core/renderer_opengl/gl_shader_manager.h" |
| 9 | 9 | ||
| 10 | namespace GLShader { | 10 | namespace OpenGL::GLShader { |
| 11 | 11 | ||
| 12 | namespace Impl { | 12 | namespace Impl { |
| 13 | static void SetShaderUniformBlockBinding(GLuint shader, const char* name, | 13 | static void SetShaderUniformBlockBinding(GLuint shader, const char* name, |
| @@ -49,4 +49,4 @@ void MaxwellUniformData::SetFromRegs(const Maxwell3D::State::ShaderStageInfo& sh | |||
| 49 | instance_id[0] = state.current_instance; | 49 | instance_id[0] = state.current_instance; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | } // namespace GLShader | 52 | } // namespace OpenGL::GLShader |
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.h b/src/video_core/renderer_opengl/gl_shader_manager.h index 75fa73605..0e7085776 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.h +++ b/src/video_core/renderer_opengl/gl_shader_manager.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "video_core/renderer_opengl/gl_shader_gen.h" | 12 | #include "video_core/renderer_opengl/gl_shader_gen.h" |
| 13 | #include "video_core/renderer_opengl/maxwell_to_gl.h" | 13 | #include "video_core/renderer_opengl/maxwell_to_gl.h" |
| 14 | 14 | ||
| 15 | namespace GLShader { | 15 | namespace OpenGL::GLShader { |
| 16 | 16 | ||
| 17 | /// Number of OpenGL texture samplers that can be used in the fragment shader | 17 | /// Number of OpenGL texture samplers that can be used in the fragment shader |
| 18 | static constexpr size_t NumTextureSamplers = 32; | 18 | static constexpr size_t NumTextureSamplers = 32; |
| @@ -171,4 +171,4 @@ private: | |||
| 171 | OGLPipeline pipeline; | 171 | OGLPipeline pipeline; |
| 172 | }; | 172 | }; |
| 173 | 173 | ||
| 174 | } // namespace GLShader | 174 | } // namespace OpenGL::GLShader |
diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index 3c087d638..5781d9d16 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 9 | #include "video_core/renderer_opengl/gl_shader_util.h" | 9 | #include "video_core/renderer_opengl/gl_shader_util.h" |
| 10 | 10 | ||
| 11 | namespace GLShader { | 11 | namespace OpenGL::GLShader { |
| 12 | 12 | ||
| 13 | GLuint LoadShader(const char* source, GLenum type) { | 13 | GLuint LoadShader(const char* source, GLenum type) { |
| 14 | const char* debug_type; | 14 | const char* debug_type; |
| @@ -47,4 +47,4 @@ GLuint LoadShader(const char* source, GLenum type) { | |||
| 47 | return shader_id; | 47 | return shader_id; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | } // namespace GLShader | 50 | } // namespace OpenGL::GLShader |
diff --git a/src/video_core/renderer_opengl/gl_shader_util.h b/src/video_core/renderer_opengl/gl_shader_util.h index 0e4d782e2..285594f50 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.h +++ b/src/video_core/renderer_opengl/gl_shader_util.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "common/assert.h" | 10 | #include "common/assert.h" |
| 11 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 12 | 12 | ||
| 13 | namespace GLShader { | 13 | namespace OpenGL::GLShader { |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| 16 | * Utility function to log the source code of a list of shaders. | 16 | * Utility function to log the source code of a list of shaders. |
| @@ -89,4 +89,4 @@ GLuint LoadProgram(bool separable_program, T... shaders) { | |||
| 89 | return program_id; | 89 | return program_id; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | } // namespace GLShader | 92 | } // namespace OpenGL::GLShader |
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 13399ceb8..e1a887d67 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "video_core/renderer_opengl/gl_state.h" | 8 | #include "video_core/renderer_opengl/gl_state.h" |
| 9 | 9 | ||
| 10 | namespace OpenGL { | ||
| 11 | |||
| 10 | OpenGLState OpenGLState::cur_state; | 12 | OpenGLState OpenGLState::cur_state; |
| 11 | 13 | ||
| 12 | OpenGLState::OpenGLState() { | 14 | OpenGLState::OpenGLState() { |
| @@ -338,3 +340,5 @@ OpenGLState& OpenGLState::ResetFramebuffer(GLuint handle) { | |||
| 338 | } | 340 | } |
| 339 | return *this; | 341 | return *this; |
| 340 | } | 342 | } |
| 343 | |||
| 344 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 219b65a8a..22b0b1e41 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | 9 | ||
| 10 | #include "video_core/engines/maxwell_3d.h" | 10 | #include "video_core/engines/maxwell_3d.h" |
| 11 | 11 | ||
| 12 | namespace OpenGL { | ||
| 13 | |||
| 12 | using Regs = Tegra::Engines::Maxwell3D::Regs; | 14 | using Regs = Tegra::Engines::Maxwell3D::Regs; |
| 13 | 15 | ||
| 14 | namespace TextureUnits { | 16 | namespace TextureUnits { |
| @@ -163,3 +165,5 @@ public: | |||
| 163 | private: | 165 | private: |
| 164 | static OpenGLState cur_state; | 166 | static OpenGLState cur_state; |
| 165 | }; | 167 | }; |
| 168 | |||
| 169 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_stream_buffer.cpp b/src/video_core/renderer_opengl/gl_stream_buffer.cpp index 03a8ed8b7..e565afcee 100644 --- a/src/video_core/renderer_opengl/gl_stream_buffer.cpp +++ b/src/video_core/renderer_opengl/gl_stream_buffer.cpp | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #include "video_core/renderer_opengl/gl_state.h" | 9 | #include "video_core/renderer_opengl/gl_state.h" |
| 10 | #include "video_core/renderer_opengl/gl_stream_buffer.h" | 10 | #include "video_core/renderer_opengl/gl_stream_buffer.h" |
| 11 | 11 | ||
| 12 | namespace OpenGL { | ||
| 13 | |||
| 12 | OGLStreamBuffer::OGLStreamBuffer(GLenum target, GLsizeiptr size, bool prefer_coherent) | 14 | OGLStreamBuffer::OGLStreamBuffer(GLenum target, GLsizeiptr size, bool prefer_coherent) |
| 13 | : gl_target(target), buffer_size(size) { | 15 | : gl_target(target), buffer_size(size) { |
| 14 | gl_buffer.Create(); | 16 | gl_buffer.Create(); |
| @@ -97,3 +99,5 @@ void OGLStreamBuffer::Unmap(GLsizeiptr size) { | |||
| 97 | 99 | ||
| 98 | buffer_pos += size; | 100 | buffer_pos += size; |
| 99 | } | 101 | } |
| 102 | |||
| 103 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/gl_stream_buffer.h b/src/video_core/renderer_opengl/gl_stream_buffer.h index 3b0cdf6bc..ae7961bd7 100644 --- a/src/video_core/renderer_opengl/gl_stream_buffer.h +++ b/src/video_core/renderer_opengl/gl_stream_buffer.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "video_core/renderer_opengl/gl_resource_manager.h" | 10 | #include "video_core/renderer_opengl/gl_resource_manager.h" |
| 11 | 11 | ||
| 12 | namespace OpenGL { | ||
| 13 | |||
| 12 | class OGLStreamBuffer : private NonCopyable { | 14 | class OGLStreamBuffer : private NonCopyable { |
| 13 | public: | 15 | public: |
| 14 | explicit OGLStreamBuffer(GLenum target, GLsizeiptr size, bool prefer_coherent = false); | 16 | explicit OGLStreamBuffer(GLenum target, GLsizeiptr size, bool prefer_coherent = false); |
| @@ -42,3 +44,5 @@ private: | |||
| 42 | GLsizeiptr mapped_size = 0; | 44 | GLsizeiptr mapped_size = 0; |
| 43 | u8* mapped_ptr = nullptr; | 45 | u8* mapped_ptr = nullptr; |
| 44 | }; | 46 | }; |
| 47 | |||
| 48 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 0d55b3e17..0343759a6 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 11 | #include "video_core/engines/maxwell_3d.h" | 11 | #include "video_core/engines/maxwell_3d.h" |
| 12 | 12 | ||
| 13 | namespace OpenGL { | ||
| 14 | |||
| 13 | using GLvec2 = std::array<GLfloat, 2>; | 15 | using GLvec2 = std::array<GLfloat, 2>; |
| 14 | using GLvec3 = std::array<GLfloat, 3>; | 16 | using GLvec3 = std::array<GLfloat, 3>; |
| 15 | using GLvec4 = std::array<GLfloat, 4>; | 17 | using GLvec4 = std::array<GLfloat, 4>; |
| @@ -360,3 +362,4 @@ inline GLenum LogicOp(Maxwell::LogicOperation operation) { | |||
| 360 | } | 362 | } |
| 361 | 363 | ||
| 362 | } // namespace MaxwellToGL | 364 | } // namespace MaxwellToGL |
| 365 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index eef13dddc..73d6419b4 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #include "video_core/renderer_opengl/renderer_opengl.h" | 20 | #include "video_core/renderer_opengl/renderer_opengl.h" |
| 21 | #include "video_core/utils.h" | 21 | #include "video_core/utils.h" |
| 22 | 22 | ||
| 23 | namespace OpenGL { | ||
| 24 | |||
| 23 | static const char vertex_shader[] = R"( | 25 | static const char vertex_shader[] = R"( |
| 24 | #version 150 core | 26 | #version 150 core |
| 25 | 27 | ||
| @@ -476,3 +478,5 @@ bool RendererOpenGL::Init() { | |||
| 476 | 478 | ||
| 477 | /// Shutdown the renderer | 479 | /// Shutdown the renderer |
| 478 | void RendererOpenGL::ShutDown() {} | 480 | void RendererOpenGL::ShutDown() {} |
| 481 | |||
| 482 | } // namespace OpenGL | ||
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 7ae103f04..961467a62 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h | |||
| @@ -16,6 +16,8 @@ namespace Core::Frontend { | |||
| 16 | class EmuWindow; | 16 | class EmuWindow; |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | namespace OpenGL { | ||
| 20 | |||
| 19 | /// Structure used for storing information about the textures for the Switch screen | 21 | /// Structure used for storing information about the textures for the Switch screen |
| 20 | struct TextureInfo { | 22 | struct TextureInfo { |
| 21 | OGLTexture resource; | 23 | OGLTexture resource; |
| @@ -98,3 +100,5 @@ private: | |||
| 98 | Tegra::FramebufferConfig::TransformFlags framebuffer_transform_flags; | 100 | Tegra::FramebufferConfig::TransformFlags framebuffer_transform_flags; |
| 99 | MathUtil::Rectangle<int> framebuffer_crop_rect; | 101 | MathUtil::Rectangle<int> framebuffer_crop_rect; |
| 100 | }; | 102 | }; |
| 103 | |||
| 104 | } // namespace OpenGL | ||
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 6780d1c16..07e3a7d24 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | namespace VideoCore { | 10 | namespace VideoCore { |
| 11 | 11 | ||
| 12 | std::unique_ptr<RendererBase> CreateRenderer(Core::Frontend::EmuWindow& emu_window) { | 12 | std::unique_ptr<RendererBase> CreateRenderer(Core::Frontend::EmuWindow& emu_window) { |
| 13 | return std::make_unique<RendererOpenGL>(emu_window); | 13 | return std::make_unique<OpenGL::RendererOpenGL>(emu_window); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | } // namespace VideoCore | 16 | } // namespace VideoCore |