diff --git a/GPU/Directx9/FramebufferDX9.cpp b/GPU/Directx9/FramebufferDX9.cpp index 30c2d54010..fd56340d95 100644 --- a/GPU/Directx9/FramebufferDX9.cpp +++ b/GPU/Directx9/FramebufferDX9.cpp @@ -295,20 +295,6 @@ namespace DX9 { DrawActiveTexture(drawPixelsTex_, x, y, w, h, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight, false, 0.0f, 0.0f, 480.0f / 512.0f); } - // Depth in ogl is between -1;1 we need between 0;1 - static void ConvertMatrices(Matrix4x4 & in) { - /* - in.zz *= 0.5f; - in.wz += 1.f; - */ - Matrix4x4 s; - Matrix4x4 t; - s.setScaling(Vec3(1, 1, 0.5f)); - t.setTranslation(Vec3(0, 0, 0.5f)); - in = in * s; - in = in * t; - } - void FramebufferManagerDX9::DrawActiveTexture(LPDIRECT3DTEXTURE9 tex, float x, float y, float w, float h, float destW, float destH, bool flip, float u0, float v0, float u1, float v1) { if (flip) { std::swap(v0, v1); diff --git a/GPU/Directx9/ShaderManagerDX9.cpp b/GPU/Directx9/ShaderManagerDX9.cpp index b58e9687d3..9a85ec5bfb 100644 --- a/GPU/Directx9/ShaderManagerDX9.cpp +++ b/GPU/Directx9/ShaderManagerDX9.cpp @@ -223,27 +223,17 @@ void ShaderManagerDX9::VSSetMatrix(int creg, const float* pMatrix) { // Depth in ogl is between -1;1 we need between 0;1 and optionally reverse it static void ConvertProjMatrixToD3D(Matrix4x4 &in, bool invertedX, bool invertedY, bool invertedZ) { - Matrix4x4 s; - Matrix4x4 t; - - s.setScaling(Vec3(gstate_c.vpWidthScale, gstate_c.vpHeightScale, invertedZ ? -0.5 : 0.5f)); float xoff = 0.5f / gstate_c.curRTRenderWidth; xoff = gstate_c.vpXOffset + (invertedX ? xoff : -xoff); - float yoff = 0.5f / gstate_c.curRTRenderHeight; + float yoff = -0.5f / gstate_c.curRTRenderHeight; yoff = gstate_c.vpYOffset + (invertedY ? yoff : -yoff); - t.setTranslation(Vec3(xoff, yoff, 0.5f)); - in = in * s * t; + in.translateAndScale(Vec3(xoff, yoff, 0.5f), Vec3(gstate_c.vpWidthScale, gstate_c.vpHeightScale, invertedZ ? -0.5 : 0.5f)); } static void ConvertProjMatrixToD3DThrough(Matrix4x4 &in) { - Matrix4x4 s; - Matrix4x4 t; - - s.setScaling(Vec3(1.0f, 1.0f, 0.5f)); float xoff = -0.5f / gstate_c.curRTRenderWidth; - float yoff = -0.5f / gstate_c.curRTRenderHeight; - t.setTranslation(Vec3(xoff, yoff, 0.5f)); - in = in * s * t; + float yoff = 0.5f / gstate_c.curRTRenderHeight; + in.translateAndScale(Vec3(xoff, yoff, 0.5f), Vec3(1.0f, 1.0f, 0.5f)); } void ShaderManagerDX9::PSUpdateUniforms(int dirtyUniforms) { diff --git a/native b/native index d942ab2d47..64de93e8be 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit d942ab2d47696c2ed1a61f257363dbfad9c609c9 +Subproject commit 64de93e8bef343766cd074a2d34e0a70ee2b628d