diff --git a/GPU/GLES/FragmentShaderGeneratorGLES.cpp b/GPU/GLES/FragmentShaderGeneratorGLES.cpp index 1b063aff6a..97f319fd7e 100644 --- a/GPU/GLES/FragmentShaderGeneratorGLES.cpp +++ b/GPU/GLES/FragmentShaderGeneratorGLES.cpp @@ -311,8 +311,13 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, uint64_t *uniform // TODO: Not sure the right way to do this for projection. // This path destroys resolution on older PowerVR no matter what I do if projection is needed, // so we disable it on SGX 540 and lesser, and live with the consequences. - bool badPrecision = (gl_extensions.bugs & BUG_PVR_SHADER_PRECISION_TERRIBLE) != 0; - if (needShaderTexClamp && !(doTextureProjection && badPrecision)) { + bool terriblePrecision = (gl_extensions.bugs & BUG_PVR_SHADER_PRECISION_TERRIBLE) != 0; + bool clampDisabled = doTextureProjection && terriblePrecision; + // Also with terrible precision we can't do wrapping without destroying the image. See #9189 + if (terriblePrecision && (!id.Bit(FS_BIT_CLAMP_S) || !id.Bit(FS_BIT_CLAMP_T))) { + clampDisabled = true; + } + if (needShaderTexClamp && !clampDisabled) { // We may be clamping inside a larger surface (tex = 64x64, buffer=480x272). // We may also be wrapping in such a surface, or either one in a too-small surface. // Obviously, clamping to a smaller surface won't work. But better to clamp to something. @@ -355,6 +360,7 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, uint64_t *uniform } else { if (doTextureProjection) { // We don't use textureProj because we need better control and it's probably not much of a savings anyway. + // However it is good for precision on older hardware like PowerVR. WRITE(p, " vec2 uv = %s.xy/%s.z;\n vec2 uv_round;\n", texcoord, texcoord); } else { WRITE(p, " vec2 uv = %s.xy;\n vec2 uv_round;\n", texcoord); diff --git a/ext/native/gfx_es2/gpu_features.cpp b/ext/native/gfx_es2/gpu_features.cpp index 9dc0bd7b1c..3f8a56b014 100644 --- a/ext/native/gfx_es2/gpu_features.cpp +++ b/ext/native/gfx_es2/gpu_features.cpp @@ -99,7 +99,10 @@ void ProcessGPUFeatures() { DLOG("Checking for GL driver bugs... vendor=%i model='%s'", (int)gl_extensions.gpuVendor, gl_extensions.model); if (gl_extensions.gpuVendor == GPU_VENDOR_IMGTEC) { - if (!strcmp(gl_extensions.model, "PowerVR SGX 543") || + if (!strcmp(gl_extensions.model, "PowerVR SGX 545") || + !strcmp(gl_extensions.model, "PowerVR SGX 544") || + !strcmp(gl_extensions.model, "PowerVR SGX 544MP2") || + !strcmp(gl_extensions.model, "PowerVR SGX 543") || !strcmp(gl_extensions.model, "PowerVR SGX 540") || !strcmp(gl_extensions.model, "PowerVR SGX 530") || !strcmp(gl_extensions.model, "PowerVR SGX 520") ) {