Vulkan ARM mali Z hack: Modify the matrix instead of the shader.

This commit is contained in:
Henrik Rydgård 2019-09-09 00:09:57 +02:00
parent 0462c01228
commit f76adfd760
4 changed files with 8 additions and 7 deletions

View file

@ -151,6 +151,10 @@ void BaseUpdateUniforms(UB_VS_FS_Base *ub, uint64_t dirtyUniforms, bool flipView
flippedMatrix = flippedMatrix * g_display_rot_matrix;
}
if (gstate_c.Supports(GPU_NEEDS_DEPTH_SCALE_HACK)) {
flippedMatrix[10] *= DEPTH_SCALE_HACK_VALUE;
}
CopyMatrix4x4(ub->proj, flippedMatrix.getReadPtr());
}
@ -164,6 +168,7 @@ void BaseUpdateUniforms(UB_VS_FS_Base *ub, uint64_t dirtyUniforms, bool flipView
if (g_Config.iRenderingMode == FB_NON_BUFFERED_MODE && g_display_rotation != DisplayRotation::ROTATE_0) {
proj_through = proj_through * g_display_rot_matrix;
}
proj_through[10] *= 0.999f;
CopyMatrix4x4(ub->proj_through, proj_through.getReadPtr());
}