mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 02:38:37 +12:00
gl: Restrict insert_vertex_input_fetch workaround to Intel proprietary
It works fine on Mesa iris Fixes detection of Mesa as recent Mesa does not have "x.org" on vendor string, allowing vendor_MESA to become true instead of vendor_INTEL on Mesa Intel
This commit is contained in:
parent
377e2ce3e8
commit
581176fb1a
2 changed files with 14 additions and 9 deletions
|
@ -253,6 +253,7 @@ namespace glsl
|
||||||
"#define get_s16(v, s) preserve_sign_s16(get_bits(v, s))\n\n";
|
"#define get_s16(v, s) preserve_sign_s16(get_bits(v, s))\n\n";
|
||||||
|
|
||||||
// For intel GPUs which cannot access vectors in indexed mode (driver bug? or glsl version too low?)
|
// For intel GPUs which cannot access vectors in indexed mode (driver bug? or glsl version too low?)
|
||||||
|
// Note: Tested on Mesa iris with HD 530 and compilant path works fine, may be a bug on Windows proprietary drivers
|
||||||
if (!glsl4_compliant)
|
if (!glsl4_compliant)
|
||||||
{
|
{
|
||||||
OS <<
|
OS <<
|
||||||
|
|
|
@ -111,6 +111,9 @@ namespace gl
|
||||||
int find_count = 12;
|
int find_count = 12;
|
||||||
int ext_count = 0;
|
int ext_count = 0;
|
||||||
glGetIntegerv(GL_NUM_EXTENSIONS, &ext_count);
|
glGetIntegerv(GL_NUM_EXTENSIONS, &ext_count);
|
||||||
|
std::string vendor_string = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
|
||||||
|
std::string version_string = reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
||||||
|
std::string renderer_string = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
|
||||||
|
|
||||||
for (int i = 0; i < ext_count; i++)
|
for (int i = 0; i < ext_count; i++)
|
||||||
{
|
{
|
||||||
|
@ -203,8 +206,13 @@ namespace gl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check GL_VERSION and GL_RENDERER for the presence of Mesa
|
||||||
|
if (version_string.find("Mesa") != umax || renderer_string.find("Mesa") != umax)
|
||||||
|
{
|
||||||
|
vendor_MESA = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Workaround for intel drivers which have terrible capability reporting
|
// Workaround for intel drivers which have terrible capability reporting
|
||||||
std::string vendor_string = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
|
|
||||||
if (!vendor_string.empty())
|
if (!vendor_string.empty())
|
||||||
{
|
{
|
||||||
std::transform(vendor_string.begin(), vendor_string.end(), vendor_string.begin(), ::tolower);
|
std::transform(vendor_string.begin(), vendor_string.end(), vendor_string.begin(), ::tolower);
|
||||||
|
@ -215,7 +223,7 @@ namespace gl
|
||||||
vendor_string = "intel"; // lowest acceptable value
|
vendor_string = "intel"; // lowest acceptable value
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vendor_string.find("intel") != umax)
|
if (!vendor_MESA && vendor_string.find("intel") != umax)
|
||||||
{
|
{
|
||||||
int version_major = 0;
|
int version_major = 0;
|
||||||
int version_minor = 0;
|
int version_minor = 0;
|
||||||
|
@ -239,14 +247,10 @@ namespace gl
|
||||||
if (!EXT_dsa_supported && glGetTextureImageEXT && glTextureBufferRangeEXT)
|
if (!EXT_dsa_supported && glGetTextureImageEXT && glTextureBufferRangeEXT)
|
||||||
EXT_dsa_supported = true;
|
EXT_dsa_supported = true;
|
||||||
}
|
}
|
||||||
else if (vendor_string.find("nvidia") != umax)
|
else if (!vendor_MESA && vendor_string.find("nvidia") != umax)
|
||||||
{
|
{
|
||||||
vendor_NVIDIA = true;
|
vendor_NVIDIA = true;
|
||||||
}
|
}
|
||||||
else if (vendor_string.find("x.org") != umax)
|
|
||||||
{
|
|
||||||
vendor_MESA = true;
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
else if (vendor_string.find("amd") != umax || vendor_string.find("ati") != umax)
|
else if (vendor_string.find("amd") != umax || vendor_string.find("ati") != umax)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue