From cc2227fbc3fdb22d19036a7721b30b099190b716 Mon Sep 17 00:00:00 2001 From: Yuriy O'Donnell Date: Sat, 25 Oct 2014 00:26:28 +0200 Subject: D3D: Replaced shader-based depth range remap with viewport This fixes UI rendering in some games mentioned in https://code.google.com/p/dolphin-emu/issues/detail?id=7785 --- Source/Core/VideoCommon/VertexShaderGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp') diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 24c6f39f46..c0faf21000 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -405,7 +405,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ //if not early z culling will improve speed if (api_type == API_D3D) { - out.Write("o.pos.z = " I_DEPTHPARAMS".x * o.pos.w + o.pos.z * " I_DEPTHPARAMS".y;\n"); + out.Write("o.pos.z = o.pos.w + o.pos.z;\n"); } else // OGL { -- cgit v1.2.3 From a886d8a8ee97ced9b8d4868d604d08b54886b06a Mon Sep 17 00:00:00 2001 From: Yuriy O'Donnell Date: Sat, 25 Oct 2014 02:59:02 +0200 Subject: Renamed DEPTHPARAMS to PIXELCENTERCORRECTION This shader constant was previously used for depth remapping in D3D and for pixel center correction. Now it only serves one purpose and the new name makes it clear. --- Source/Core/VideoCommon/VertexShaderGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp') diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index c0faf21000..26d6942372 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -430,7 +430,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ // which in turn can be critical if it happens for clear quads. // Hence, we compensate for this pixel center difference so that primitives // get rasterized correctly. - out.Write("o.pos.xy = o.pos.xy - " I_DEPTHPARAMS".zw;\n"); + out.Write("o.pos.xy = o.pos.xy - " I_PIXELCENTERCORRECTION".xy;\n"); if (api_type == API_OPENGL) { -- cgit v1.2.3