From 8676891f773af96c38683cbf8489e6aa7bddc0c0 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Mon, 22 Dec 2014 03:36:39 +0100 Subject: [PATCH] VertexShaderGen: Don't read from output variables. --- Source/Core/VideoCommon/VertexShaderGen.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 07b349dc35..98ca1d8451 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -78,7 +78,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ { out.Write("out VertexData {\n"); GenerateVSOutputMembers(out, api_type, g_ActiveConfig.backend_info.bSupportsBindingLayout ? "centroid" : "centroid out"); - out.Write("} o;\n"); + out.Write("} vs;\n"); } else { @@ -98,9 +98,6 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ } out.Write("void main()\n{\n"); - - if (!g_ActiveConfig.backend_info.bSupportsGeometryShaders) - out.Write("VS_OUTPUT o;\n"); } else // D3D { @@ -126,10 +123,10 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ if (components & VB_HAS_POSMTXIDX) out.Write(" int posmtx : BLENDINDICES,\n"); out.Write(" float4 rawpos : POSITION) {\n"); - - out.Write("VS_OUTPUT o;\n"); } + out.Write("VS_OUTPUT o;\n"); + // transforms if (components & VB_HAS_POSMTXIDX) { @@ -386,7 +383,11 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ if (api_type == API_OPENGL) { - if (!g_ActiveConfig.backend_info.bSupportsGeometryShaders) + if (g_ActiveConfig.backend_info.bSupportsGeometryShaders) + { + AssignVSOutputMembers(out, "vs", "o"); + } + else { // TODO: Pass interface blocks between shader stages even if geometry shaders // are not supported, however that will require at least OpenGL 3.2 support.