diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-10-26 19:17:00 +0100 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-11-23 14:23:41 +0100 |
| commit | f6ea293027e553cf89f780ec2a1b716cc026a4b5 (patch) | |
| tree | 7ff15360896c93b727b70dc311fd91530f8e6b19 /Source/Core/VideoCommon/VertexShaderGen.cpp | |
| parent | c64486075d728b3682b77ed06d5c154fd4a5c88d (diff) | |
VertexShaderManager: Compute stereoscopy projection matrices.
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderGen.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 2667445908..d7fd94ddec 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -52,6 +52,9 @@ static inline void GenerateVSOutputStruct(T& object, API_TYPE api_type) if (g_ActiveConfig.bEnablePixelLighting) DefineVSOutputStructMember(object, api_type, "float4", "Normal", -1, "TEXCOORD", xfmem.numTexGen.numTexGens + 1); + if (g_ActiveConfig.bStereo) + DefineVSOutputStructMember(object, api_type, "float4", "rawpos", -1, "POSITION"); + object.Write("};\n"); } @@ -99,6 +102,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ "\tfloat4 " I_NORMALMATRICES"[32];\n" "\tfloat4 " I_POSTTRANSFORMMATRICES"[64];\n" "\tfloat4 " I_DEPTHPARAMS";\n" + "\tfloat4 " I_STEREOPROJECTION"[8];\n" "};\n"); GenerateVSOutputStruct(out, api_type); @@ -215,6 +219,9 @@ 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"); + if (g_ActiveConfig.bStereo) + out.Write("o.rawpos = pos;\n"); + out.Write("int4 lacc;\n" "float3 ldir, h;\n" "float dist, dist2, attn;\n"); |
