From b236c363de097ca8164c315e37dc369139a8a20c Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Tue, 28 Oct 2014 19:27:05 +0100 Subject: [PATCH] ShaderGen: Add a stereoscopy flag in the UID data. --- Source/Core/VideoCommon/PixelShaderGen.cpp | 1 + Source/Core/VideoCommon/PixelShaderGen.h | 2 ++ Source/Core/VideoCommon/VertexShaderGen.cpp | 1 + Source/Core/VideoCommon/VertexShaderGen.h | 2 ++ 4 files changed, 6 insertions(+) diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index edad01ee77..d2124f2ad7 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -335,6 +335,7 @@ 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"); + uid_data->stereo = g_ActiveConfig.bStereo; if (g_ActiveConfig.bStereo) out.Write("flat in int eye;\n"); diff --git a/Source/Core/VideoCommon/PixelShaderGen.h b/Source/Core/VideoCommon/PixelShaderGen.h index 369f940619..26ec28d33f 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.h +++ b/Source/Core/VideoCommon/PixelShaderGen.h @@ -119,6 +119,8 @@ struct pixel_shader_uid_data // TODO: I think we're fine without an enablePixelLighting field, should probably double check, though.. LightingUidData lighting; + + u32 stereo : 1; }; #pragma pack() diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index d7fd94ddec..0daaaf3275 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -219,6 +219,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ out.Write("o.pos = float4(dot(" I_PROJECTION"[0], pos), dot(" I_PROJECTION"[1], pos), dot(" I_PROJECTION"[2], pos), dot(" I_PROJECTION"[3], pos));\n"); + uid_data->stereo = g_ActiveConfig.bStereo; if (g_ActiveConfig.bStereo) out.Write("o.rawpos = pos;\n"); diff --git a/Source/Core/VideoCommon/VertexShaderGen.h b/Source/Core/VideoCommon/VertexShaderGen.h index 998f8fe6bc..a7b5e9bd3f 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.h +++ b/Source/Core/VideoCommon/VertexShaderGen.h @@ -56,6 +56,8 @@ struct vertex_shader_uid_data } postMtxInfo[8]; LightingUidData lighting; + + u32 stereo : 1; }; #pragma pack()