mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix T89405: Viewport Render Preview glitching (AMD)
AMD Drivers didn't report an additional space in the rendered. This made testing for the HQ workaround fail and the issue appeared back on certain cards. This fix will test with surrounding spaces or if the renderer name endswith the given string. If any of these are the case the hq normals workaround will be enabled.
This commit is contained in:
parent
3c6a981fd9
commit
2c7efe5ac0
1 changed files with 31 additions and 9 deletions
|
|
@ -38,6 +38,17 @@ namespace blender::gpu {
|
|||
/** \name Platform
|
||||
* \{ */
|
||||
|
||||
static bool match_renderer(StringRef renderer, const Vector<std::string> &items)
|
||||
{
|
||||
for (const std::string &item : items) {
|
||||
const std::string wrapped = " " + item + " ";
|
||||
if (renderer.endswith(item) || renderer.find(wrapped) != StringRef::not_found) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void GLBackend::platform_init()
|
||||
{
|
||||
BLI_assert(!GPG.initialized);
|
||||
|
|
@ -281,15 +292,26 @@ static void detect_workarounds()
|
|||
* `GL_INT_2_10_10_10_REV` data type correctly. This data type is used to pack normals and flags.
|
||||
* The work around uses `GPU_RGBA16I`.
|
||||
*/
|
||||
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) {
|
||||
if (strstr(renderer, " RX 460 ") || strstr(renderer, " RX 470 ") ||
|
||||
strstr(renderer, " RX 480 ") || strstr(renderer, " RX 490 ") ||
|
||||
strstr(renderer, " RX 560 ") || strstr(renderer, " RX 560X ") ||
|
||||
strstr(renderer, " RX 570 ") || strstr(renderer, " RX 580 ") ||
|
||||
strstr(renderer, " RX 580X ") || strstr(renderer, " RX 590 ") ||
|
||||
strstr(renderer, " RX550/550 ") || strstr(renderer, "(TM) 520 ") ||
|
||||
strstr(renderer, "(TM) 530 ") || strstr(renderer, "(TM) 535 ") ||
|
||||
strstr(renderer, " R5 ") || strstr(renderer, " R7 ") || strstr(renderer, " R9 ")) {
|
||||
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY)) {
|
||||
const Vector<std::string> matches = {"RX 460",
|
||||
"RX 470",
|
||||
"RX 480",
|
||||
"RX 490",
|
||||
"RX 560",
|
||||
"RX 560X",
|
||||
"RX 570",
|
||||
"RX 580",
|
||||
"RX 580X",
|
||||
"RX 590",
|
||||
"RX550/550",
|
||||
"(TM) 520",
|
||||
"(TM) 530",
|
||||
"(TM) 535",
|
||||
"R5",
|
||||
"R7",
|
||||
"R9"};
|
||||
|
||||
if (match_renderer(renderer, matches)) {
|
||||
GCaps.use_hq_normals_workaround = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue