Merge pull request #748 from lioncash/namespace

video_core: Use nested namespaces where applicable
This commit is contained in:
bunnei 2018-07-21 18:50:14 -07:00 committed by GitHub
commit 3ac736c003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 24 additions and 48 deletions

View file

@ -6,8 +6,7 @@
#include "video_core/engines/fermi_2d.h" #include "video_core/engines/fermi_2d.h"
#include "video_core/textures/decoders.h" #include "video_core/textures/decoders.h"
namespace Tegra { namespace Tegra::Engines {
namespace Engines {
Fermi2D::Fermi2D(MemoryManager& memory_manager) : memory_manager(memory_manager) {} Fermi2D::Fermi2D(MemoryManager& memory_manager) : memory_manager(memory_manager) {}
@ -69,5 +68,4 @@ void Fermi2D::HandleSurfaceCopy() {
} }
} }
} // namespace Engines } // namespace Tegra::Engines
} // namespace Tegra

View file

@ -12,8 +12,7 @@
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/memory_manager.h" #include "video_core/memory_manager.h"
namespace Tegra { namespace Tegra::Engines {
namespace Engines {
#define FERMI2D_REG_INDEX(field_name) \ #define FERMI2D_REG_INDEX(field_name) \
(offsetof(Tegra::Engines::Fermi2D::Regs, field_name) / sizeof(u32)) (offsetof(Tegra::Engines::Fermi2D::Regs, field_name) / sizeof(u32))
@ -110,5 +109,4 @@ ASSERT_REG_POSITION(operation, 0xAB);
ASSERT_REG_POSITION(trigger, 0xB5); ASSERT_REG_POSITION(trigger, 0xB5);
#undef ASSERT_REG_POSITION #undef ASSERT_REG_POSITION
} // namespace Engines } // namespace Tegra::Engines
} // namespace Tegra

View file

@ -17,8 +17,7 @@
#include "video_core/memory_manager.h" #include "video_core/memory_manager.h"
#include "video_core/textures/texture.h" #include "video_core/textures/texture.h"
namespace Tegra { namespace Tegra::Engines {
namespace Engines {
#define MAXWELL3D_REG_INDEX(field_name) \ #define MAXWELL3D_REG_INDEX(field_name) \
(offsetof(Tegra::Engines::Maxwell3D::Regs, field_name) / sizeof(u32)) (offsetof(Tegra::Engines::Maxwell3D::Regs, field_name) / sizeof(u32))
@ -898,5 +897,4 @@ ASSERT_REG_POSITION(tex_info_buffers.size[0], 0xD2F);
#undef ASSERT_REG_POSITION #undef ASSERT_REG_POSITION
} // namespace Engines } // namespace Tegra::Engines
} // namespace Tegra

View file

@ -6,8 +6,7 @@
#include "common/common_types.h" #include "common/common_types.h"
namespace Tegra { namespace Tegra::Engines {
namespace Engines {
class MaxwellCompute final { class MaxwellCompute final {
public: public:
@ -18,5 +17,4 @@ public:
void WriteReg(u32 method, u32 value); void WriteReg(u32 method, u32 value);
}; };
} // namespace Engines } // namespace Tegra::Engines
} // namespace Tegra

View file

@ -12,8 +12,7 @@
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/memory_manager.h" #include "video_core/memory_manager.h"
namespace Tegra { namespace Tegra::Engines {
namespace Engines {
class MaxwellDMA final { class MaxwellDMA final {
public: public:
@ -151,5 +150,4 @@ ASSERT_REG_POSITION(src_params, 0x1CA);
#undef ASSERT_REG_POSITION #undef ASSERT_REG_POSITION
} // namespace Engines } // namespace Tegra::Engines
} // namespace Tegra

View file

@ -15,8 +15,7 @@
#include "common/bit_field.h" #include "common/bit_field.h"
#include "common/common_types.h" #include "common/common_types.h"
namespace Tegra { namespace Tegra::Shader {
namespace Shader {
struct Register { struct Register {
/// Number of registers /// Number of registers
@ -109,8 +108,7 @@ union Sampler {
u64 value{}; u64 value{};
}; };
} // namespace Shader } // namespace Tegra::Shader
} // namespace Tegra
namespace std { namespace std {
@ -127,8 +125,7 @@ struct make_unsigned<Tegra::Shader::Register> {
} // namespace std } // namespace std
namespace Tegra { namespace Tegra::Shader {
namespace Shader {
enum class Pred : u64 { enum class Pred : u64 {
UnusedIndex = 0x7, UnusedIndex = 0x7,
@ -784,5 +781,4 @@ private:
} }
}; };
} // namespace Shader } // namespace Tegra::Shader
} // namespace Tegra

View file

@ -12,8 +12,7 @@
#include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/renderer_opengl/gl_rasterizer.h"
#include "video_core/renderer_opengl/gl_shader_decompiler.h" #include "video_core/renderer_opengl/gl_shader_decompiler.h"
namespace GLShader { namespace GLShader::Decompiler {
namespace Decompiler {
using Tegra::Shader::Attribute; using Tegra::Shader::Attribute;
using Tegra::Shader::Instruction; using Tegra::Shader::Instruction;
@ -1845,5 +1844,4 @@ boost::optional<ProgramResult> DecompileProgram(const ProgramCode& program_code,
return boost::none; return boost::none;
} }
} // namespace Decompiler } // namespace GLShader::Decompiler
} // namespace GLShader

View file

@ -12,8 +12,7 @@
#include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_3d.h"
#include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/renderer_opengl/gl_shader_gen.h"
namespace GLShader { namespace GLShader::Decompiler {
namespace Decompiler {
using Tegra::Engines::Maxwell3D; using Tegra::Engines::Maxwell3D;
@ -23,5 +22,4 @@ boost::optional<ProgramResult> DecompileProgram(const ProgramCode& program_code,
Maxwell3D::Regs::ShaderStage stage, Maxwell3D::Regs::ShaderStage stage,
const std::string& suffix); const std::string& suffix);
} // namespace Decompiler } // namespace GLShader::Decompiler
} // namespace GLShader

View file

@ -10,8 +10,7 @@
#include "video_core/textures/decoders.h" #include "video_core/textures/decoders.h"
#include "video_core/textures/texture.h" #include "video_core/textures/texture.h"
namespace Tegra { namespace Tegra::Texture {
namespace Texture {
/** /**
* Calculates the offset of an (x, y) position within a swizzled texture. * 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
return rgba_data; return rgba_data;
} }
} // namespace Texture } // namespace Tegra::Texture
} // namespace Tegra

View file

@ -8,8 +8,7 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/textures/texture.h" #include "video_core/textures/texture.h"
namespace Tegra { namespace Tegra::Texture {
namespace Texture {
/** /**
* Unswizzles a swizzled texture without changing its format. * 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_
std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat format, u32 width, std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat format, u32 width,
u32 height); u32 height);
} // namespace Texture } // namespace Tegra::Texture
} // namespace Tegra

View file

@ -10,8 +10,7 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/memory_manager.h" #include "video_core/memory_manager.h"
namespace Tegra { namespace Tegra::Texture {
namespace Texture {
enum class TextureFormat : u32 { enum class TextureFormat : u32 {
R32_G32_B32_A32 = 0x01, R32_G32_B32_A32 = 0x01,
@ -260,5 +259,4 @@ struct FullTextureInfo {
/// Returns the number of bytes per pixel of the input texture format. /// Returns the number of bytes per pixel of the input texture format.
u32 BytesPerPixel(TextureFormat format); u32 BytesPerPixel(TextureFormat format);
} // namespace Texture } // namespace Tegra::Texture
} // namespace Tegra