diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-10-30 23:29:56 +0100 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-11-23 14:27:38 +0100 |
| commit | 9b22e151803ccfb757eb9319f1b32e3d1999f42e (patch) | |
| tree | a4ca5f293bb1b89104d26327f0aa9bbe8eb737e8 /Source/Core/VideoCommon | |
| parent | 4d9589b35f2629c558a9a7efdee3d66497fc0fc6 (diff) | |
VideoConfigDiag: Add stereoscopy options group.
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/GeometryShaderGen.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderGen.cpp | 12 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderManager.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.h | 6 |
6 files changed, 21 insertions, 21 deletions
diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index 88be1d4098..cded3bdea1 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -41,12 +41,12 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy out.Write("//Geometry Shader for 3D stereoscopy\n"); - uid_data->stereo = g_ActiveConfig.bStereo; + uid_data->stereo = g_ActiveConfig.iStereoMode > 0; if (ApiType == API_OPENGL) { // Insert layout parameters if (g_ActiveConfig.backend_info.bSupportsGSInstancing) - out.Write("layout(triangles, invocations = %d) in;\n", g_ActiveConfig.bStereo ? 2 : 1); + out.Write("layout(triangles, invocations = %d) in;\n", g_ActiveConfig.iStereoMode > 0 ? 2 : 1); else out.Write("layout(triangles) in;\n"); out.Write("layout(triangle_strip, max_vertices = %d) out;\n", g_ActiveConfig.backend_info.bSupportsGSInstancing ? 3 : 6); @@ -74,7 +74,7 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy if (g_ActiveConfig.backend_info.bSupportsGSInstancing) out.Write("\tlayer = gl_InvocationID;\n"); else - out.Write("\tfor (layer = 0; layer < %d; ++layer) {\n", g_ActiveConfig.bStereo ? 2 : 1); + out.Write("\tfor (layer = 0; layer < %d; ++layer) {\n", g_ActiveConfig.iStereoMode > 0 ? 2 : 1); out.Write("\tgl_Layer = layer;\n"); out.Write("\tvec4 stereoproj = "I_PROJECTION"[0];\n"); @@ -83,7 +83,7 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy out.Write("\tfor (int i = 0; i < gl_in.length(); ++i) {\n"); out.Write("\t\to = v[i];\n"); - if (g_ActiveConfig.bStereo) + if (g_ActiveConfig.iStereoMode > 0) out.Write("\t\to.pos = float4(dot(stereoproj, v[i].rawpos), dot(" I_PROJECTION"[1], v[i].rawpos), dot(" I_PROJECTION"[2], v[i].rawpos), dot(" I_PROJECTION"[3], v[i].rawpos)); \n"); out.Write("\t\tgl_Position = o.pos;\n"); diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 4f0c7ea5e1..11c9679ca9 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -321,8 +321,8 @@ 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) + uid_data->stereo = g_ActiveConfig.iStereoMode > 0; + if (g_ActiveConfig.iStereoMode > 0) out.Write("flat in int layer;\n"); out.Write("void main()\n{\n"); @@ -926,7 +926,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, %s))).%s;\n", texmap, texcoords, texmap, g_ActiveConfig.bStereo ? "layer" : "0.0", texswap); + out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texcoords, texmap, g_ActiveConfig.iStereoMode > 0 ? "layer" : "0.0", texswap); } static const char *tevAlphaFuncsTable[] = diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 7c5ca62464..fd2ee7f3e6 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -52,7 +52,7 @@ 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) + if (g_ActiveConfig.iStereoMode > 0) DefineVSOutputStructMember(object, api_type, "float4", "rawpos", -1, "POSITION"); object.Write("};\n"); @@ -125,11 +125,11 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ out.Write("in float%d tex%d; // ATTR%d,\n", hastexmtx ? 3 : 2, i, SHADER_TEXTURE0_ATTRIB + i); } - out.Write("centroid out VS_OUTPUT %s;\n", (g_ActiveConfig.bStereo) ? "v" : "o"); + out.Write("centroid out VS_OUTPUT %s;\n", (g_ActiveConfig.iStereoMode > 0) ? "v" : "o"); out.Write("void main()\n{\n"); - if (g_ActiveConfig.bStereo) + if (g_ActiveConfig.iStereoMode > 0) out.Write("VS_OUTPUT o;\n"); } else // D3D @@ -205,8 +205,8 @@ 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) + uid_data->stereo = g_ActiveConfig.iStereoMode > 0; + if (g_ActiveConfig.iStereoMode > 0) out.Write("o.rawpos = pos;\n"); out.Write("int4 lacc;\n" @@ -420,7 +420,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ if (api_type == API_OPENGL) { - if (g_ActiveConfig.bStereo) + if (g_ActiveConfig.iStereoMode > 0) out.Write("v = o;\n"); out.Write("gl_Position = o.pos;\n"); diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 5d65a49186..ad69ba4362 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -513,7 +513,7 @@ void VertexShaderManager::SetConstants() memcpy(constants.projection, correctedMtx.data, 4*16); } - if (g_ActiveConfig.bStereo && xfmem.projection.type == GX_PERSPECTIVE) + if (g_ActiveConfig.iStereoMode > 0 && xfmem.projection.type == GX_PERSPECTIVE) { float offset = g_ActiveConfig.iStereoSeparation / (200.0f * g_ActiveConfig.iStereoFocalLength); constants.stereooffset[0] = offset; diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index af073fab5e..18e098652d 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -66,7 +66,7 @@ void VideoConfig::Load(const std::string& ini_file) settings->Get("DumpEFBTarget", &bDumpEFBTarget, 0); settings->Get("FreeLook", &bFreeLook, 0); settings->Get("UseFFV1", &bUseFFV1, 0); - settings->Get("Stereo", &bStereo, false); + settings->Get("StereoMode", &iStereoMode, 0); settings->Get("StereoSeparation", &iStereoSeparation, 65); settings->Get("StereoFocalLength", &iStereoFocalLength, 100); settings->Get("EnablePixelLighting", &bEnablePixelLighting, 0); @@ -140,7 +140,7 @@ void VideoConfig::GameIniLoad() CHECK_SETTING("Video_Settings", "UseRealXFB", bUseRealXFB); CHECK_SETTING("Video_Settings", "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples); CHECK_SETTING("Video_Settings", "HiresTextures", bHiresTextures); - CHECK_SETTING("Video_Settings", "Stereo", bStereo); + CHECK_SETTING("Video_Settings", "StereoMode", iStereoMode); CHECK_SETTING("Video_Settings", "StereoSeparation", iStereoSeparation); CHECK_SETTING("Video_Settings", "StereoFocalLength", iStereoFocalLength); CHECK_SETTING("Video_Settings", "EnablePixelLighting", bEnablePixelLighting); @@ -203,7 +203,7 @@ void VideoConfig::VerifyValidity() // TODO: Check iMaxAnisotropy value if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0; if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0; - if (!backend_info.bSupportsStereoscopy) bStereo = false; + if (!backend_info.bSupportsStereoscopy) iStereoMode = 0; } void VideoConfig::Save(const std::string& ini_file) @@ -231,7 +231,7 @@ void VideoConfig::Save(const std::string& ini_file) settings->Set("DumpEFBTarget", bDumpEFBTarget); settings->Set("FreeLook", bFreeLook); settings->Set("UseFFV1", bUseFFV1); - settings->Set("Stereo", bStereo); + settings->Set("StereoMode", iStereoMode); settings->Set("StereoSeparation", iStereoSeparation); settings->Set("StereoFocalLength", iStereoFocalLength); settings->Set("EnablePixelLighting", bEnablePixelLighting); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index b1682bab58..a44b0a78a2 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -71,6 +71,9 @@ struct VideoConfig final bool bForceFiltering; int iMaxAnisotropy; std::string sPostProcessingShader; + int iStereoMode; + int iStereoSeparation; + int iStereoFocalLength; // Information bool bShowFPS; @@ -92,9 +95,6 @@ struct VideoConfig final bool bDumpEFBTarget; bool bUseFFV1; bool bFreeLook; - bool bStereo; - int iStereoSeparation; - int iStereoFocalLength; bool bBorderlessFullscreen; // Hacks |
