VideoCommon/FramebufferShaderGen: Use an anonymous namespace where applicable

Places all internal helpers and types within an anonymous namespace.
This commit is contained in:
Lioncash 2019-12-04 23:51:23 -05:00
parent eefd6a10f5
commit 3a8d17c140
1 changed files with 15 additions and 13 deletions

View File

@ -12,12 +12,14 @@
namespace FramebufferShaderGen namespace FramebufferShaderGen
{ {
static APIType GetAPIType() namespace
{
APIType GetAPIType()
{ {
return g_ActiveConfig.backend_info.api_type; return g_ActiveConfig.backend_info.api_type;
} }
static void EmitUniformBufferDeclaration(std::stringstream& ss) void EmitUniformBufferDeclaration(std::stringstream& ss)
{ {
if (GetAPIType() == APIType::D3D) if (GetAPIType() == APIType::D3D)
ss << "cbuffer PSBlock : register(b0)\n"; ss << "cbuffer PSBlock : register(b0)\n";
@ -25,7 +27,7 @@ static void EmitUniformBufferDeclaration(std::stringstream& ss)
ss << "UBO_BINDING(std140, 1) uniform PSBlock\n"; ss << "UBO_BINDING(std140, 1) uniform PSBlock\n";
} }
static void EmitSamplerDeclarations(std::stringstream& ss, u32 start = 0, u32 end = 1, void EmitSamplerDeclarations(std::stringstream& ss, u32 start = 0, u32 end = 1,
bool multisampled = false) bool multisampled = false)
{ {
switch (GetAPIType()) switch (GetAPIType())
@ -57,7 +59,7 @@ static void EmitSamplerDeclarations(std::stringstream& ss, u32 start = 0, u32 en
} }
} }
static void EmitSampleTexture(std::stringstream& ss, u32 n, const char* coords) void EmitSampleTexture(std::stringstream& ss, u32 n, const char* coords)
{ {
switch (GetAPIType()) switch (GetAPIType())
{ {
@ -77,7 +79,7 @@ static void EmitSampleTexture(std::stringstream& ss, u32 n, const char* coords)
// Emits a texel fetch/load instruction. Assumes that "coords" is a 4-element vector, with z // Emits a texel fetch/load instruction. Assumes that "coords" is a 4-element vector, with z
// containing the layer, and w containing the mipmap level. // containing the layer, and w containing the mipmap level.
static void EmitTextureLoad(std::stringstream& ss, u32 n, const char* coords) void EmitTextureLoad(std::stringstream& ss, u32 n, const char* coords)
{ {
switch (GetAPIType()) switch (GetAPIType())
{ {
@ -95,9 +97,8 @@ static void EmitTextureLoad(std::stringstream& ss, u32 n, const char* coords)
} }
} }
static void EmitVertexMainDeclaration(std::stringstream& ss, u32 num_tex_inputs, void EmitVertexMainDeclaration(std::stringstream& ss, u32 num_tex_inputs, u32 num_color_inputs,
u32 num_color_inputs, bool position_input, bool position_input, u32 num_tex_outputs, u32 num_color_outputs,
u32 num_tex_outputs, u32 num_color_outputs,
const char* extra_inputs = "") const char* extra_inputs = "")
{ {
switch (GetAPIType()) switch (GetAPIType())
@ -162,9 +163,9 @@ static void EmitVertexMainDeclaration(std::stringstream& ss, u32 num_tex_inputs,
} }
} }
static void EmitPixelMainDeclaration(std::stringstream& ss, u32 num_tex_inputs, void EmitPixelMainDeclaration(std::stringstream& ss, u32 num_tex_inputs, u32 num_color_inputs,
u32 num_color_inputs, const char* output_type = "float4", const char* output_type = "float4", const char* extra_vars = "",
const char* extra_vars = "", bool emit_frag_coord = false) bool emit_frag_coord = false)
{ {
switch (GetAPIType()) switch (GetAPIType())
{ {
@ -213,6 +214,7 @@ static void EmitPixelMainDeclaration(std::stringstream& ss, u32 num_tex_inputs,
break; break;
} }
} }
} // Anonymous namespace
std::string GenerateScreenQuadVertexShader() std::string GenerateScreenQuadVertexShader()
{ {