gl: Add mesa support for polygon offset

This commit is contained in:
kd-11 2022-10-10 19:06:33 +03:00 committed by kd-11
parent a229e30b08
commit 65d20f2d08
2 changed files with 12 additions and 1 deletions

View File

@ -267,7 +267,7 @@ void GLGSRender::update_draw_state()
// Check details in VKDraw.cpp about behaviour of RSX vs desktop D24X8 implementations
// TLDR, RSX expects R = 16,777,215 (2^24 - 1)
const auto& caps = gl::get_driver_caps();
if (caps.vendor_NVIDIA)
if (caps.vendor_NVIDIA || caps.vendor_MESA)
{
// R derived to be 8388607 (2^23 - 1)
poly_offset_bias *= 0.5f;

View File

@ -30,6 +30,8 @@ namespace gl
bool vendor_AMD = false; // has broken ARB_multidraw
bool vendor_NVIDIA = false; // has NaN poisoning issues
bool vendor_MESA = false; // requires CLIENT_STORAGE bit set for streaming buffers
bool subvendor_RADEONSI = false;
bool subvendor_NOUVEAU = false;
bool check(const std::string& ext_name, const char* test)
{
@ -174,6 +176,15 @@ namespace gl
if (version_string.find("Mesa") != umax || renderer_string.find("Mesa") != umax)
{
vendor_MESA = true;
if (vendor_string.find("nouveau") != umax)
{
subvendor_NOUVEAU = true;
}
else if (vendor_string.find("AMD") != umax)
{
subvendor_RADEONSI = true;
}
}
// Workaround for intel drivers which have terrible capability reporting