mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 12:47:46 +00:00
Vulkan ARM mali Z hack: Modify the matrix instead of the shader.
This commit is contained in:
parent
0462c01228
commit
f76adfd760
@ -363,6 +363,3 @@ std::string FormatDriverVersion(const VkPhysicalDeviceProperties &props);
|
||||
|
||||
// Simple heuristic.
|
||||
bool IsHashMaliDriverVersion(const VkPhysicalDeviceProperties &props);
|
||||
|
||||
// For the ARM Mali depth scale hack.
|
||||
#define DEPTH_SCALE_HACK_VALUE 0.9999f
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -500,6 +500,9 @@ enum {
|
||||
GPU_PREFER_REVERSE_COLOR_ORDER = FLAG_BIT(31),
|
||||
};
|
||||
|
||||
// For the ARM Mali depth scale hack.
|
||||
#define DEPTH_SCALE_HACK_VALUE 0.9999f
|
||||
|
||||
struct KnownVertexBounds {
|
||||
u16 minU;
|
||||
u16 minV;
|
||||
|
@ -636,10 +636,6 @@ bool GenerateVulkanGLSLVertexShader(const VShaderID &id, char *buffer) {
|
||||
}
|
||||
WRITE(p, " gl_Position = outPos;\n");
|
||||
|
||||
if (gstate_c.Supports(GPU_NEEDS_DEPTH_SCALE_HACK)) {
|
||||
WRITE(p, " gl_Position.z *= %f;\n", DEPTH_SCALE_HACK_VALUE);
|
||||
}
|
||||
|
||||
WRITE(p, "}\n");
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user