From 14e0b48ae43c3625f8571dec88121c91d575c65c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 21 Jul 2016 19:04:57 -0400 Subject: VideoCommon: Make API_TYPE an enum class Allows for forward declarations in most places, which prevents dumping unrelated VideoCommon.h contents directly into headers. --- Source/Core/VideoCommon/VertexShaderGen.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp') diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 77444e7dfc..aa69550bd8 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -12,6 +12,7 @@ #include "VideoCommon/NativeVertexFormat.h" #include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexShaderGen.h" +#include "VideoCommon/VideoCommon.h" #include "VideoCommon/VideoConfig.h" VertexShaderUid GetVertexShaderUid() @@ -78,13 +79,13 @@ VertexShaderUid GetVertexShaderUid() return out; } -ShaderCode GenerateVertexShaderCode(API_TYPE api_type, const vertex_shader_uid_data* uid_data) +ShaderCode GenerateVertexShaderCode(APIType api_type, const vertex_shader_uid_data* uid_data) { ShaderCode out; out.Write("%s", s_lighting_struct); // uniforms - if (api_type == API_OPENGL) + if (api_type == APIType::OpenGL) out.Write("layout(std140%s) uniform VSBlock {\n", g_ActiveConfig.backend_info.bSupportsBindingLayout ? ", binding = 2" : ""); else @@ -96,7 +97,7 @@ ShaderCode GenerateVertexShaderCode(API_TYPE api_type, const vertex_shader_uid_d GenerateVSOutputMembers(out, api_type, uid_data->numTexGens, uid_data->pixel_lighting, ""); out.Write("};\n"); - if (api_type == API_OPENGL) + if (api_type == APIType::OpenGL) { out.Write("in float4 rawpos; // ATTR%d,\n", SHADER_POSITION_ATTRIB); if (uid_data->components & VB_HAS_POSMTXIDX) @@ -430,7 +431,7 @@ ShaderCode GenerateVertexShaderCode(API_TYPE api_type, const vertex_shader_uid_d // get rasterized correctly. out.Write("o.pos.xy = o.pos.xy - o.pos.w * " I_PIXELCENTERCORRECTION ".xy;\n"); - if (api_type == API_OPENGL) + if (api_type == APIType::OpenGL) { if (g_ActiveConfig.backend_info.bSupportsGeometryShaders) { -- cgit v1.2.3