From d355ad70554ff2655b1e12a83663cd43f8483320 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 11 Jan 2012 16:00:30 -0600 Subject: [PATCH] More 'stuff' --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 8 +++++--- Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index e7dc8b73db..6ce7fdd417 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -724,10 +724,12 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType } if (DepthTextureEnable) WRITE(p, " float depth;\n"); // TODO: Passed to Vertex Shader right? - WRITE(p, "VARYIN float4 rawpos;\n"); + WRITE(p, " float4 rawpos = gl_FragCoord;\n"); - WRITE(p, " float4 colors_0 = gl_Color;\n"); - WRITE(p, " float4 colors_1 = gl_SecondaryColor;\n"); + WRITE(p, "VARYIN float4 colors_02;\n"); + WRITE(p, "VARYIN float4 colors_12;\n"); + WRITE(p, " float4 colors_0 = colors_02;\n"); + WRITE(p, " float4 colors_1 = colors_12;\n"); // compute window position if needed because binding semantic WPOS is not widely supported // Let's set up attributes diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index a616d00674..e05e299a3a 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -298,10 +298,11 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType) WRITE(p, "VARYOUT float%d uv%d_2;\n", i < 4 ? 4 : 3 , i); } } - WRITE(p, "VARYOUT float4 rawpos;\n") ; + WRITE(p, " float4 rawpos = gl_Vertex;\n"); + WRITE(p, "VARYOUT float4 colors_02;\n"); + WRITE(p, "VARYOUT float4 colors_12;\n"); WRITE(p, "void main()\n{\n"); - WRITE(p, "rawpos = gl_Vertex;\n"); } else { @@ -620,8 +621,8 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType) WRITE(p, " uv%d_2%s = o.tex%d;\n", i, i < 4 ? ".xyzw" : ".xyz" , i); } } - WRITE(p, "gl_FrontColor = o.colors_0;\n"); - WRITE(p, "gl_FrontSecondaryColor = o.colors_1;\n"); + WRITE(p, "colors_02 = o.colors_0;\n"); + WRITE(p, "colors_12 = o.colors_1;\n"); WRITE(p, "gl_Position = o.pos;\n"); WRITE(p, "}\n"); }