Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Add some AMD GPUs to the OpenGL blocklist. #84568

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@
If [code]true[/code], the compatibility renderer will fall back to native OpenGL if ANGLE over Metal is not supported.
[b]Note:[/b] This setting is implemented only on macOS.
</member>
<member name="rendering/gl_compatibility/force_angle_on_devices" type="Array" setter="" getter="" default="[]">
<member name="rendering/gl_compatibility/force_angle_on_devices" type="Array" setter="" getter="">
An [Array] of devices which should always use the ANGLE renderer.
Each entry is a [Dictionary] with the following keys: [code]vendor[/code] and [code]name[/code]. [code]name[/code] can be set to [code]*[/code] to add all devices with the specified [code]vendor[/code].
[b]Note:[/b] This setting is implemented only on Windows.
Expand Down
23 changes: 22 additions & 1 deletion main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,28 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
GLOBAL_DEF_RST("rendering/gl_compatibility/fallback_to_native", true);
GLOBAL_DEF_RST("rendering/gl_compatibility/fallback_to_gles", true);

GLOBAL_DEF_RST(PropertyInfo(Variant::ARRAY, "rendering/gl_compatibility/force_angle_on_devices", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::DICTIONARY, PROPERTY_HINT_NONE, String())), Array());
Array device_blocklist;

#define BLOCK_DEVICE(m_vendor, m_name) \
{ \
Dictionary device; \
device["vendor"] = m_vendor; \
device["name"] = m_name; \
device_blocklist.push_back(device); \
}

// AMD GPUs.
BLOCK_DEVICE("ATI", "AMD Radeon(TM) R2 Graphics");
BLOCK_DEVICE("ATI", "AMD Radeon(TM) R3 Graphics");
BLOCK_DEVICE("ATI", "AMD Radeon HD 8400 / R3 Series");
BLOCK_DEVICE("ATI", "AMD Radeon R5 M200 Series");
BLOCK_DEVICE("ATI", "AMD Radeon R5 M230 Series");
BLOCK_DEVICE("ATI", "AMD Radeon R5 M255");
BLOCK_DEVICE("AMD", "AMD Radeon (TM) R5 M330");

#undef BLOCK_DEVICE

GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::ARRAY, "rendering/gl_compatibility/force_angle_on_devices", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::DICTIONARY, PROPERTY_HINT_NONE, String())), device_blocklist);
}

// Start with RenderingDevice-based backends. Should be included if any RD driver present.
Expand Down
2 changes: 1 addition & 1 deletion platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4658,7 +4658,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
Array device_list = GLOBAL_GET("rendering/gl_compatibility/force_angle_on_devices");
for (int i = 0; i < device_list.size(); i++) {
const Dictionary &device = device_list[i];
if (device.has("vendor") && device.has("name") && device["vendor"].operator String().to_upper() == gl_info["vendor"].operator String().to_upper() && (device["name"] == "*" || device["name"].operator String().to_upper() == gl_info["name"].operator String().to_upper())) {
if (device.has("vendor") && device.has("name") && gl_info["vendor"].operator String().to_upper().contains(device["vendor"].operator String().to_upper()) && (device["name"] == "*" || gl_info["name"].operator String().to_upper().contains(device["name"].operator String().to_upper()))) {
force_angle = true;
break;
}
Expand Down
Loading