diff options
| author | 2019-03-31 00:24:10 -0300 | |
|---|---|---|
| committer | 2019-03-31 00:26:34 -0300 | |
| commit | 38658b38b459f39de58fe1059f5bd682e402c69f (patch) | |
| tree | 4b1d07b94ac1baeea435f9debcf4d7aae7970c09 /src | |
| parent | shader_ir/decode: Silent implicit sign conversion warning (diff) | |
| download | yuzu-38658b38b459f39de58fe1059f5bd682e402c69f.tar.gz yuzu-38658b38b459f39de58fe1059f5bd682e402c69f.tar.xz yuzu-38658b38b459f39de58fe1059f5bd682e402c69f.zip | |
gl_shader_decompiler: Hide local definitions inside an anonymous namespace
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index df00ea85d..41dc32fad 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | namespace OpenGL::GLShader { | 22 | namespace OpenGL::GLShader { |
| 23 | 23 | ||
| 24 | namespace { | ||
| 25 | |||
| 24 | using Tegra::Shader::Attribute; | 26 | using Tegra::Shader::Attribute; |
| 25 | using Tegra::Shader::AttributeUse; | 27 | using Tegra::Shader::AttributeUse; |
| 26 | using Tegra::Shader::Header; | 28 | using Tegra::Shader::Header; |
| @@ -36,11 +38,9 @@ using Operation = const OperationNode&; | |||
| 36 | 38 | ||
| 37 | enum class Type { Bool, Bool2, Float, Int, Uint, HalfFloat }; | 39 | enum class Type { Bool, Bool2, Float, Int, Uint, HalfFloat }; |
| 38 | 40 | ||
| 39 | namespace { | ||
| 40 | struct TextureAoffi {}; | 41 | struct TextureAoffi {}; |
| 41 | using TextureArgument = std::pair<Type, Node>; | 42 | using TextureArgument = std::pair<Type, Node>; |
| 42 | using TextureIR = std::variant<TextureAoffi, TextureArgument>; | 43 | using TextureIR = std::variant<TextureAoffi, TextureArgument>; |
| 43 | } // namespace | ||
| 44 | 44 | ||
| 45 | enum : u32 { POSITION_VARYING_LOCATION = 0, GENERIC_VARYING_START_LOCATION = 1 }; | 45 | enum : u32 { POSITION_VARYING_LOCATION = 0, GENERIC_VARYING_START_LOCATION = 1 }; |
| 46 | constexpr u32 MAX_CONSTBUFFER_ELEMENTS = | 46 | constexpr u32 MAX_CONSTBUFFER_ELEMENTS = |
| @@ -97,7 +97,7 @@ private: | |||
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | /// Generates code to use for a swizzle operation. | 99 | /// Generates code to use for a swizzle operation. |
| 100 | static std::string GetSwizzle(u32 elem) { | 100 | std::string GetSwizzle(u32 elem) { |
| 101 | ASSERT(elem <= 3); | 101 | ASSERT(elem <= 3); |
| 102 | std::string swizzle = "."; | 102 | std::string swizzle = "."; |
| 103 | swizzle += "xyzw"[elem]; | 103 | swizzle += "xyzw"[elem]; |
| @@ -105,7 +105,7 @@ static std::string GetSwizzle(u32 elem) { | |||
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | /// Translate topology | 107 | /// Translate topology |
| 108 | static std::string GetTopologyName(Tegra::Shader::OutputTopology topology) { | 108 | std::string GetTopologyName(Tegra::Shader::OutputTopology topology) { |
| 109 | switch (topology) { | 109 | switch (topology) { |
| 110 | case Tegra::Shader::OutputTopology::PointList: | 110 | case Tegra::Shader::OutputTopology::PointList: |
| 111 | return "points"; | 111 | return "points"; |
| @@ -120,7 +120,7 @@ static std::string GetTopologyName(Tegra::Shader::OutputTopology topology) { | |||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | /// Returns true if an object has to be treated as precise | 122 | /// Returns true if an object has to be treated as precise |
| 123 | static bool IsPrecise(Operation operand) { | 123 | bool IsPrecise(Operation operand) { |
| 124 | const auto& meta = operand.GetMeta(); | 124 | const auto& meta = operand.GetMeta(); |
| 125 | 125 | ||
| 126 | if (const auto arithmetic = std::get_if<MetaArithmetic>(&meta)) { | 126 | if (const auto arithmetic = std::get_if<MetaArithmetic>(&meta)) { |
| @@ -132,7 +132,7 @@ static bool IsPrecise(Operation operand) { | |||
| 132 | return false; | 132 | return false; |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | static bool IsPrecise(Node node) { | 135 | bool IsPrecise(Node node) { |
| 136 | if (const auto operation = std::get_if<OperationNode>(node)) { | 136 | if (const auto operation = std::get_if<OperationNode>(node)) { |
| 137 | return IsPrecise(*operation); | 137 | return IsPrecise(*operation); |
| 138 | } | 138 | } |
| @@ -1612,6 +1612,8 @@ private: | |||
| 1612 | ShaderWriter code; | 1612 | ShaderWriter code; |
| 1613 | }; | 1613 | }; |
| 1614 | 1614 | ||
| 1615 | } // Anonymous namespace | ||
| 1616 | |||
| 1615 | std::string GetCommonDeclarations() { | 1617 | std::string GetCommonDeclarations() { |
| 1616 | const auto cbuf = std::to_string(MAX_CONSTBUFFER_ELEMENTS); | 1618 | const auto cbuf = std::to_string(MAX_CONSTBUFFER_ELEMENTS); |
| 1617 | const auto gmem = std::to_string(MAX_GLOBALMEMORY_ELEMENTS); | 1619 | const auto gmem = std::to_string(MAX_GLOBALMEMORY_ELEMENTS); |