diff options
| author | pierre <pierre@pirsoft.de> | 2010-08-05 23:04:34 +0000 |
|---|---|---|
| committer | pierre <pierre@pirsoft.de> | 2010-08-05 23:04:34 +0000 |
| commit | 92b180b71fa73713208627f741e8dce32d8650db (patch) | |
| tree | 9b202e5cc234e47e654a31de2f37d2f41b566587 /Source/Core/VideoCommon/Src/VertexShaderGen.cpp | |
| parent | d5d7beb6c708b019f30c20f9d62c0f72423d151d (diff) | |
Opengl and D3D are doing the perspective division differently
Thanks to glennricster for catching this.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6061 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index 401eab7058..f04bc5ed15 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -465,7 +465,11 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type) //write the true depth value, if the game uses depth textures pixel shaders will override with the correct values //if not early z culling will improve speed - WRITE(p, "o.pos.z = "I_DEPTHPARAMS".x * o.pos.w + o.pos.z * "I_DEPTHPARAMS".y;\n"); + if (is_d3d) { + WRITE(p, "o.pos.z = "I_DEPTHPARAMS".x * o.pos.w + o.pos.z * "I_DEPTHPARAMS".y;\n"); + } else { + WRITE(p, "o.pos.z = "I_DEPTHPARAMS".x * o.pos.w + o.pos.z * "I_DEPTHPARAMS".y * 2.0f;\n"); + } WRITE(p, "return o;\n}\n"); |
