summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-03-31 00:24:10 -0300
committerGravatar ReinUsesLisp2019-03-31 00:26:34 -0300
commit38658b38b459f39de58fe1059f5bd682e402c69f (patch)
tree4b1d07b94ac1baeea435f9debcf4d7aae7970c09 /src
parentshader_ir/decode: Silent implicit sign conversion warning (diff)
downloadyuzu-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.cpp14
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
22namespace OpenGL::GLShader { 22namespace OpenGL::GLShader {
23 23
24namespace {
25
24using Tegra::Shader::Attribute; 26using Tegra::Shader::Attribute;
25using Tegra::Shader::AttributeUse; 27using Tegra::Shader::AttributeUse;
26using Tegra::Shader::Header; 28using Tegra::Shader::Header;
@@ -36,11 +38,9 @@ using Operation = const OperationNode&;
36 38
37enum class Type { Bool, Bool2, Float, Int, Uint, HalfFloat }; 39enum class Type { Bool, Bool2, Float, Int, Uint, HalfFloat };
38 40
39namespace {
40struct TextureAoffi {}; 41struct TextureAoffi {};
41using TextureArgument = std::pair<Type, Node>; 42using TextureArgument = std::pair<Type, Node>;
42using TextureIR = std::variant<TextureAoffi, TextureArgument>; 43using TextureIR = std::variant<TextureAoffi, TextureArgument>;
43} // namespace
44 44
45enum : u32 { POSITION_VARYING_LOCATION = 0, GENERIC_VARYING_START_LOCATION = 1 }; 45enum : u32 { POSITION_VARYING_LOCATION = 0, GENERIC_VARYING_START_LOCATION = 1 };
46constexpr u32 MAX_CONSTBUFFER_ELEMENTS = 46constexpr 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.
100static std::string GetSwizzle(u32 elem) { 100std::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
108static std::string GetTopologyName(Tegra::Shader::OutputTopology topology) { 108std::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
123static bool IsPrecise(Operation operand) { 123bool 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
135static bool IsPrecise(Node node) { 135bool 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
1615std::string GetCommonDeclarations() { 1617std::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);