mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Quicker way to update the through projection matrix with the split framebuffer offset
This commit is contained in:
parent
95b299766e
commit
d99e4b6714
2 changed files with 7 additions and 4 deletions
|
@ -581,7 +581,9 @@ void ConvertViewportAndScissor(bool useBufferedRendering, float renderWidth, flo
|
||||||
renderHeightFactor = renderHeight / 272.0f;
|
renderHeightFactor = renderHeight / 272.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// negative offsets we take care of in the projection matrix.
|
// We take care negative offsets of in the projection matrix.
|
||||||
|
// These come from split framebuffers (Killzone).
|
||||||
|
// TODO: Might be safe to do get rid of this here and do the same for positive offsets?
|
||||||
renderX = std::max(gstate_c.curRTOffsetX, 0);
|
renderX = std::max(gstate_c.curRTOffsetX, 0);
|
||||||
renderY = std::max(gstate_c.curRTOffsetY, 0);
|
renderY = std::max(gstate_c.curRTOffsetY, 0);
|
||||||
|
|
||||||
|
|
|
@ -152,10 +152,11 @@ void BaseUpdateUniforms(UB_VS_FS_Base *ub, uint64_t dirtyUniforms, bool flipView
|
||||||
if (!useBufferedRendering && g_display_rotation != DisplayRotation::ROTATE_0) {
|
if (!useBufferedRendering && g_display_rotation != DisplayRotation::ROTATE_0) {
|
||||||
proj_through = proj_through * g_display_rot_matrix;
|
proj_through = proj_through * g_display_rot_matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Negative RT offsets come from split framebuffers (Killzone)
|
||||||
if (gstate_c.curRTOffsetX < 0 || gstate_c.curRTOffsetY < 0) {
|
if (gstate_c.curRTOffsetX < 0 || gstate_c.curRTOffsetY < 0) {
|
||||||
Matrix4x4 xlate;
|
proj_through.wx += 2.0f * (float)gstate_c.curRTOffsetX / (float)gstate_c.curRTWidth;
|
||||||
xlate.setTranslation(Lin::Vec3(2.0f * gstate_c.curRTOffsetX / (int)gstate_c.curRTWidth, 2.0f * gstate_c.curRTOffsetY / (int)gstate_c.curRTHeight, 0.0f));
|
proj_through.wy += 2.0f * (float)gstate_c.curRTOffsetY / (float)gstate_c.curRTHeight;
|
||||||
proj_through = proj_through * xlate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyMatrix4x4(ub->proj_through, proj_through.getReadPtr());
|
CopyMatrix4x4(ub->proj_through, proj_through.getReadPtr());
|
||||||
|
|
Loading…
Add table
Reference in a new issue