Merge pull request #7206 from unknownbrackets/gpu-minor

Small optimization to viewport scale + correct y offset
This commit is contained in:
Henrik Rydgård committed 2014-12-21 22:10:10 +01:00
commit 7d39b49ec4
3 files changed
+5 -29

No files matched your search

-14
View File
@@ -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);
+4 -14
View File
@@ -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) {
+1 -1
Submodule native updated: d942ab2d47...64de93e8be.