Only enable fragment shader depth rounding for Heroes Phantasia, should reduce flicker.

Doens't fix but helps #6485
This commit is contained in:
Henrik Rydgard 2015-10-11 20:44:58 +02:00
parent fecc825e66
commit 65b78b18ea
6 changed files with 20 additions and 4 deletions

View File

@ -41,5 +41,6 @@ void Compatibility::Clear() {
void Compatibility::LoadIniSection(IniFile &iniFile, std::string section) {
iniFile.Get(section.c_str(), "NoDepthRounding", &flags_.NoDepthRounding, flags_.NoDepthRounding);
iniFile.Get(section.c_str(), "PixelDepthRounding", &flags_.PixelDepthRounding, flags_.PixelDepthRounding);
iniFile.Get(section.c_str(), "GTAMusicFix", &flags_.GTAMusicFix, flags_.GTAMusicFix);
}

View File

@ -46,6 +46,7 @@
struct CompatFlags {
bool NoDepthRounding;
bool PixelDepthRounding;
bool GTAMusicFix;
};

View File

@ -1004,7 +1004,7 @@ void GenerateFragmentShader(char *buffer) {
}
#endif
if (true) {
if (gstate_c.Supports(GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT)) {
WRITE(p, " highp float z = gl_FragCoord.z;\n");
WRITE(p, " z = (1.0/65535.0) * floor(z * 65535.0);\n");
WRITE(p, " gl_FragDepth = z;\n");

View File

@ -562,9 +562,13 @@ void GLES_GPU::CheckGPUFeatures() {
features |= GPU_SUPPORTS_TEXTURE_LOD_CONTROL;
// In the future, also disable this when we get a proper 16-bit depth buffer.
if (!PSP_CoreParameter().compat.flags().NoDepthRounding)
features |= GPU_ROUND_DEPTH_TO_16BIT;
if ((!gl_extensions.IsGLES || gl_extensions.GLES3) && PSP_CoreParameter().compat.flags().PixelDepthRounding) {
features |= GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT;
} else {
if (!PSP_CoreParameter().compat.flags().NoDepthRounding) {
features |= GPU_ROUND_DEPTH_TO_16BIT;
}
}
#ifdef MOBILE_DEVICE
// Arguably, we should turn off GPU_IS_MOBILE on like modern Tegras, etc.

View File

@ -454,6 +454,7 @@ enum {
GPU_SUPPORTS_BLEND_MINMAX = FLAG_BIT(4),
GPU_SUPPORTS_LOGIC_OP = FLAG_BIT(5),
GPU_SUPPORTS_ANY_FRAMEBUFFER_FETCH = FLAG_BIT(20),
GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT = FLAG_BIT(22),
GPU_ROUND_DEPTH_TO_16BIT = FLAG_BIT(23), // Can be disabled either per game or if we use a real 16-bit depth buffer
GPU_SUPPORTS_TEXTURE_LOD_CONTROL = FLAG_BIT(24),
GPU_SUPPORTS_FBO = FLAG_BIT(25),

View File

@ -66,6 +66,15 @@ NoDepthRounding = true
NoDepthRounding = true
# Heroes Phantasia requires pixel depth rounding.
[NPJH50558]
PixelDepthRounding = true
[ULJS00456]
PixelDepthRounding = true
[ULJS00454]
PixelDepthRounding = true
# GTA audio issues
# These games stream their radio stations from disc as giant audio files. They seek into
# the correct position. Our ATRAC3 module (sceAtrac) implementation is still not very accurate