diff --git a/src/core/gpu_hw_shadergen.cpp b/src/core/gpu_hw_shadergen.cpp index c663af7bd..83e329ec5 100644 --- a/src/core/gpu_hw_shadergen.cpp +++ b/src/core/gpu_hw_shadergen.cpp @@ -91,10 +91,14 @@ std::string GPU_HW_ShaderGen::GenerateBatchVertexShader(bool textured) // OpenGL seems to be off by one pixel in the Y direction due to lower-left origin, but only on // Intel and NVIDIA drivers. AMD is fine. V3D requires coordinates to be slightly offset even further. #if API_OPENGL || API_OPENGL_ES - #ifdef DRIVER_HACK_POS_EPSILON + #ifdef DRIVER_V3D CONSTANT float POS_EPSILON = 0.0001; #else - CONSTANT float POS_EPSILON = 0.00001; + #ifdef DRIVER_POWERVR + CONSTANT float POS_EPSILON = 0.001; + #else + CONSTANT float POS_EPSILON = 0.00001; + #endif #endif #endif )"; diff --git a/src/core/shadergen.cpp b/src/core/shadergen.cpp index 48459cba6..e17adc8be 100644 --- a/src/core/shadergen.cpp +++ b/src/core/shadergen.cpp @@ -102,11 +102,14 @@ void ShaderGen::WriteHeader(std::stringstream& ss) ss << "#extension GL_ARB_blend_func_extended : require\n"; // Test for V3D driver - we have to fudge coordinates slightly. - if ((std::strstr(reinterpret_cast(glGetString(GL_VENDOR)), "Broadcom") && - std::strstr(reinterpret_cast(glGetString(GL_RENDERER)), "V3D")) || - std::strstr(reinterpret_cast(glGetString(GL_RENDERER)), "PowerVR")) + if (std::strstr(reinterpret_cast(glGetString(GL_VENDOR)), "Broadcom") && + std::strstr(reinterpret_cast(glGetString(GL_RENDERER)), "V3D")) { - ss << "#define DRIVER_HACK_POS_EPSILON 1\n"; + ss << "#define DRIVER_V3D 1\n"; + } + else if (std::strstr(reinterpret_cast(glGetString(GL_RENDERER)), "PowerVR")) + { + ss << "#define DRIVER_POWERVR 1\n"; } } else if (m_render_api == HostDisplay::RenderAPI::OpenGL)