dx9: Small optimization to viewport scaling.

This commit is contained in:
Unknown W. Brackets committed 2014-12-21 10:35:04 -08:00
1 parent f0dc66a661
commit b9e78dab9c
2 files changed
+2 -26

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);
+2 -12
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;
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;
in.translateAndScale(Vec3(xoff, yoff, 0.5f), Vec3(1.0f, 1.0f, 0.5f));
}
void ShaderManagerDX9::PSUpdateUniforms(int dirtyUniforms) {