diff options
| author | 2018-07-20 18:14:17 -0400 | |
|---|---|---|
| committer | 2018-07-20 18:23:54 -0400 | |
| commit | bb960c8cb43a3250d971cd8bb4adc5dd0c5baccc (patch) | |
| tree | c7745ac491c15a6d4519548812a7105903410a18 /src | |
| parent | Merge pull request #740 from Subv/acc_crash (diff) | |
| download | yuzu-bb960c8cb43a3250d971cd8bb4adc5dd0c5baccc.tar.gz yuzu-bb960c8cb43a3250d971cd8bb4adc5dd0c5baccc.tar.xz yuzu-bb960c8cb43a3250d971cd8bb4adc5dd0c5baccc.zip | |
video_core: Use nested namespaces where applicable
Compresses a few namespace specifiers to be more compact.
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/engines/fermi_2d.h | 6 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 6 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_compute.h | 6 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.h | 6 | ||||
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 12 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.h | 6 | ||||
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/textures/decoders.h | 6 | ||||
| -rw-r--r-- | src/video_core/textures/texture.h | 6 |
11 files changed, 24 insertions, 48 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index 34053e393..ea1555c5d 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp | |||
| @@ -6,8 +6,7 @@ | |||
| 6 | #include "video_core/engines/fermi_2d.h" | 6 | #include "video_core/engines/fermi_2d.h" |
| 7 | #include "video_core/textures/decoders.h" | 7 | #include "video_core/textures/decoders.h" |
| 8 | 8 | ||
| 9 | namespace Tegra { | 9 | namespace Tegra::Engines { |
| 10 | namespace Engines { | ||
| 11 | 10 | ||
| 12 | Fermi2D::Fermi2D(MemoryManager& memory_manager) : memory_manager(memory_manager) {} | 11 | Fermi2D::Fermi2D(MemoryManager& memory_manager) : memory_manager(memory_manager) {} |
| 13 | 12 | ||
| @@ -69,5 +68,4 @@ void Fermi2D::HandleSurfaceCopy() { | |||
| 69 | } | 68 | } |
| 70 | } | 69 | } |
| 71 | 70 | ||
| 72 | } // namespace Engines | 71 | } // namespace Tegra::Engines |
| 73 | } // namespace Tegra | ||
diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h index 70667cb94..dcf9ef8b9 100644 --- a/src/video_core/engines/fermi_2d.h +++ b/src/video_core/engines/fermi_2d.h | |||
| @@ -12,8 +12,7 @@ | |||
| 12 | #include "video_core/gpu.h" | 12 | #include "video_core/gpu.h" |
| 13 | #include "video_core/memory_manager.h" | 13 | #include "video_core/memory_manager.h" |
| 14 | 14 | ||
| 15 | namespace Tegra { | 15 | namespace Tegra::Engines { |
| 16 | namespace Engines { | ||
| 17 | 16 | ||
| 18 | #define FERMI2D_REG_INDEX(field_name) \ | 17 | #define FERMI2D_REG_INDEX(field_name) \ |
| 19 | (offsetof(Tegra::Engines::Fermi2D::Regs, field_name) / sizeof(u32)) | 18 | (offsetof(Tegra::Engines::Fermi2D::Regs, field_name) / sizeof(u32)) |
| @@ -110,5 +109,4 @@ ASSERT_REG_POSITION(operation, 0xAB); | |||
| 110 | ASSERT_REG_POSITION(trigger, 0xB5); | 109 | ASSERT_REG_POSITION(trigger, 0xB5); |
| 111 | #undef ASSERT_REG_POSITION | 110 | #undef ASSERT_REG_POSITION |
| 112 | 111 | ||
| 113 | } // namespace Engines | 112 | } // namespace Tegra::Engines |
| 114 | } // namespace Tegra | ||
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 91b077005..dbd106c53 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -17,8 +17,7 @@ | |||
| 17 | #include "video_core/memory_manager.h" | 17 | #include "video_core/memory_manager.h" |
| 18 | #include "video_core/textures/texture.h" | 18 | #include "video_core/textures/texture.h" |
| 19 | 19 | ||
| 20 | namespace Tegra { | 20 | namespace Tegra::Engines { |
| 21 | namespace Engines { | ||
| 22 | 21 | ||
| 23 | #define MAXWELL3D_REG_INDEX(field_name) \ | 22 | #define MAXWELL3D_REG_INDEX(field_name) \ |
| 24 | (offsetof(Tegra::Engines::Maxwell3D::Regs, field_name) / sizeof(u32)) | 23 | (offsetof(Tegra::Engines::Maxwell3D::Regs, field_name) / sizeof(u32)) |
| @@ -898,5 +897,4 @@ ASSERT_REG_POSITION(tex_info_buffers.size[0], 0xD2F); | |||
| 898 | 897 | ||
| 899 | #undef ASSERT_REG_POSITION | 898 | #undef ASSERT_REG_POSITION |
| 900 | 899 | ||
| 901 | } // namespace Engines | 900 | } // namespace Tegra::Engines |
| 902 | } // namespace Tegra | ||
diff --git a/src/video_core/engines/maxwell_compute.h b/src/video_core/engines/maxwell_compute.h index 7262e1bcb..2b3e4ced6 100644 --- a/src/video_core/engines/maxwell_compute.h +++ b/src/video_core/engines/maxwell_compute.h | |||
| @@ -6,8 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace Tegra { | 9 | namespace Tegra::Engines { |
| 10 | namespace Engines { | ||
| 11 | 10 | ||
| 12 | class MaxwellCompute final { | 11 | class MaxwellCompute final { |
| 13 | public: | 12 | public: |
| @@ -18,5 +17,4 @@ public: | |||
| 18 | void WriteReg(u32 method, u32 value); | 17 | void WriteReg(u32 method, u32 value); |
| 19 | }; | 18 | }; |
| 20 | 19 | ||
| 21 | } // namespace Engines | 20 | } // namespace Tegra::Engines |
| 22 | } // namespace Tegra | ||
diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h index 905749bde..7882f16e0 100644 --- a/src/video_core/engines/maxwell_dma.h +++ b/src/video_core/engines/maxwell_dma.h | |||
| @@ -12,8 +12,7 @@ | |||
| 12 | #include "video_core/gpu.h" | 12 | #include "video_core/gpu.h" |
| 13 | #include "video_core/memory_manager.h" | 13 | #include "video_core/memory_manager.h" |
| 14 | 14 | ||
| 15 | namespace Tegra { | 15 | namespace Tegra::Engines { |
| 16 | namespace Engines { | ||
| 17 | 16 | ||
| 18 | class MaxwellDMA final { | 17 | class MaxwellDMA final { |
| 19 | public: | 18 | public: |
| @@ -151,5 +150,4 @@ ASSERT_REG_POSITION(src_params, 0x1CA); | |||
| 151 | 150 | ||
| 152 | #undef ASSERT_REG_POSITION | 151 | #undef ASSERT_REG_POSITION |
| 153 | 152 | ||
| 154 | } // namespace Engines | 153 | } // namespace Tegra::Engines |
| 155 | } // namespace Tegra | ||
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 65fa1495f..939a71022 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -15,8 +15,7 @@ | |||
| 15 | #include "common/bit_field.h" | 15 | #include "common/bit_field.h" |
| 16 | #include "common/common_types.h" | 16 | #include "common/common_types.h" |
| 17 | 17 | ||
| 18 | namespace Tegra { | 18 | namespace Tegra::Shader { |
| 19 | namespace Shader { | ||
| 20 | 19 | ||
| 21 | struct Register { | 20 | struct Register { |
| 22 | /// Number of registers | 21 | /// Number of registers |
| @@ -109,8 +108,7 @@ union Sampler { | |||
| 109 | u64 value{}; | 108 | u64 value{}; |
| 110 | }; | 109 | }; |
| 111 | 110 | ||
| 112 | } // namespace Shader | 111 | } // namespace Tegra::Shader |
| 113 | } // namespace Tegra | ||
| 114 | 112 | ||
| 115 | namespace std { | 113 | namespace std { |
| 116 | 114 | ||
| @@ -127,8 +125,7 @@ struct make_unsigned<Tegra::Shader::Register> { | |||
| 127 | 125 | ||
| 128 | } // namespace std | 126 | } // namespace std |
| 129 | 127 | ||
| 130 | namespace Tegra { | 128 | namespace Tegra::Shader { |
| 131 | namespace Shader { | ||
| 132 | 129 | ||
| 133 | enum class Pred : u64 { | 130 | enum class Pred : u64 { |
| 134 | UnusedIndex = 0x7, | 131 | UnusedIndex = 0x7, |
| @@ -784,5 +781,4 @@ private: | |||
| 784 | } | 781 | } |
| 785 | }; | 782 | }; |
| 786 | 783 | ||
| 787 | } // namespace Shader | 784 | } // namespace Tegra::Shader |
| 788 | } // namespace Tegra | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index a1ac18a71..b48d30466 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -12,8 +12,7 @@ | |||
| 12 | #include "video_core/renderer_opengl/gl_rasterizer.h" | 12 | #include "video_core/renderer_opengl/gl_rasterizer.h" |
| 13 | #include "video_core/renderer_opengl/gl_shader_decompiler.h" | 13 | #include "video_core/renderer_opengl/gl_shader_decompiler.h" |
| 14 | 14 | ||
| 15 | namespace GLShader { | 15 | namespace GLShader::Decompiler { |
| 16 | namespace Decompiler { | ||
| 17 | 16 | ||
| 18 | using Tegra::Shader::Attribute; | 17 | using Tegra::Shader::Attribute; |
| 19 | using Tegra::Shader::Instruction; | 18 | using Tegra::Shader::Instruction; |
| @@ -1845,5 +1844,4 @@ boost::optional<ProgramResult> DecompileProgram(const ProgramCode& program_code, | |||
| 1845 | return boost::none; | 1844 | return boost::none; |
| 1846 | } | 1845 | } |
| 1847 | 1846 | ||
| 1848 | } // namespace Decompiler | 1847 | } // namespace GLShader::Decompiler |
| 1849 | } // namespace GLShader | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.h b/src/video_core/renderer_opengl/gl_shader_decompiler.h index 7610dad3a..df6769462 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.h +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.h | |||
| @@ -12,8 +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 { | 15 | namespace GLShader::Decompiler { |
| 16 | namespace Decompiler { | ||
| 17 | 16 | ||
| 18 | using Tegra::Engines::Maxwell3D; | 17 | using Tegra::Engines::Maxwell3D; |
| 19 | 18 | ||
| @@ -23,5 +22,4 @@ boost::optional<ProgramResult> DecompileProgram(const ProgramCode& program_code, | |||
| 23 | Maxwell3D::Regs::ShaderStage stage, | 22 | Maxwell3D::Regs::ShaderStage stage, |
| 24 | const std::string& suffix); | 23 | const std::string& suffix); |
| 25 | 24 | ||
| 26 | } // namespace Decompiler | 25 | } // namespace GLShader::Decompiler |
| 27 | } // namespace GLShader | ||
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index a3684a195..a3e67d105 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -10,8 +10,7 @@ | |||
| 10 | #include "video_core/textures/decoders.h" | 10 | #include "video_core/textures/decoders.h" |
| 11 | #include "video_core/textures/texture.h" | 11 | #include "video_core/textures/texture.h" |
| 12 | 12 | ||
| 13 | namespace Tegra { | 13 | namespace Tegra::Texture { |
| 14 | namespace Texture { | ||
| 15 | 14 | ||
| 16 | /** | 15 | /** |
| 17 | * Calculates the offset of an (x, y) position within a swizzled texture. | 16 | * Calculates the offset of an (x, y) position within a swizzled texture. |
| @@ -186,5 +185,4 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat | |||
| 186 | return rgba_data; | 185 | return rgba_data; |
| 187 | } | 186 | } |
| 188 | 187 | ||
| 189 | } // namespace Texture | 188 | } // namespace Tegra::Texture |
| 190 | } // namespace Tegra | ||
diff --git a/src/video_core/textures/decoders.h b/src/video_core/textures/decoders.h index 2b088c077..73a4924d1 100644 --- a/src/video_core/textures/decoders.h +++ b/src/video_core/textures/decoders.h | |||
| @@ -8,8 +8,7 @@ | |||
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "video_core/textures/texture.h" | 9 | #include "video_core/textures/texture.h" |
| 10 | 10 | ||
| 11 | namespace Tegra { | 11 | namespace Tegra::Texture { |
| 12 | namespace Texture { | ||
| 13 | 12 | ||
| 14 | /** | 13 | /** |
| 15 | * Unswizzles a swizzled texture without changing its format. | 14 | * Unswizzles a swizzled texture without changing its format. |
| @@ -33,5 +32,4 @@ void CopySwizzledData(u32 width, u32 height, u32 bytes_per_pixel, u32 out_bytes_ | |||
| 33 | std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat format, u32 width, | 32 | std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat format, u32 width, |
| 34 | u32 height); | 33 | u32 height); |
| 35 | 34 | ||
| 36 | } // namespace Texture | 35 | } // namespace Tegra::Texture |
| 37 | } // namespace Tegra | ||
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index a17eaf19d..d1c755033 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -10,8 +10,7 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "video_core/memory_manager.h" | 11 | #include "video_core/memory_manager.h" |
| 12 | 12 | ||
| 13 | namespace Tegra { | 13 | namespace Tegra::Texture { |
| 14 | namespace Texture { | ||
| 15 | 14 | ||
| 16 | enum class TextureFormat : u32 { | 15 | enum class TextureFormat : u32 { |
| 17 | R32_G32_B32_A32 = 0x01, | 16 | R32_G32_B32_A32 = 0x01, |
| @@ -260,5 +259,4 @@ struct FullTextureInfo { | |||
| 260 | /// Returns the number of bytes per pixel of the input texture format. | 259 | /// Returns the number of bytes per pixel of the input texture format. |
| 261 | u32 BytesPerPixel(TextureFormat format); | 260 | u32 BytesPerPixel(TextureFormat format); |
| 262 | 261 | ||
| 263 | } // namespace Texture | 262 | } // namespace Tegra::Texture |
| 264 | } // namespace Tegra | ||