diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-10-27 00:29:37 +0100 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-11-23 14:23:41 +0100 |
| commit | d9e280e338b9b05d3651a5fe53d933999310aa7c (patch) | |
| tree | 7b3b653fbfde2624484809dbabf73851f8e94d10 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | f6ea293027e553cf89f780ec2a1b716cc026a4b5 (diff) | |
PixelShaderGen: Sample the correct texture layer.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index bc98377049..edad01ee77 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -335,6 +335,9 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T // Without MSAA, this flag is defined to have no effect. out.Write("centroid in VS_OUTPUT o;\n"); + if (g_ActiveConfig.bStereo) + out.Write("flat in int eye;\n"); + out.Write("void main()\n{\n"); // compute window position if needed because binding semantic WPOS is not widely supported @@ -936,7 +939,7 @@ static inline void SampleTexture(T& out, const char *texcoords, const char *texs if (ApiType == API_D3D) out.Write("iround(255.0 * Tex%d.Sample(samp%d,%s.xy * " I_TEXDIMS"[%d].xy)).%s;\n", texmap,texmap, texcoords, texmap, texswap); else - out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, 0.0))).%s;\n", texmap, texcoords, texmap, texswap); + out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texcoords, texmap, g_ActiveConfig.bStereo ? "eye" : "0.0", texswap); } static const char *tevAlphaFuncsTable[] = |
