Skip to content

Commit 69044ee

Browse files
committed
Merge branch 'vnext'
2 parents a952319 + c7b11fe commit 69044ee

File tree

4 files changed

+67
-27
lines changed

4 files changed

+67
-27
lines changed

CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs

+4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ internal partial class LogParser
201201
["RSX: Your GPU does not support"] = UnsupportedDeviceFeatures(),
202202
["RSX: GPU/driver lacks support"] = UnsupportedDriverFeatures(),
203203
["RSX: Swapchain:"] = SwapchainMode(),
204+
["RSX: ** Using"] = VkExtensions(),
205+
["RSX: [CAPS] Using"] = GlExtensions(),
204206
["F "] = FatalError(),
205207
["Failed to load RAP file:"] = FailedToLoadRap(),
206208
["Rap file not found:"] = RapNotFound(),
@@ -261,6 +263,8 @@ internal partial class LogParser
261263
"edat_block_offset",
262264
"failed_to_verify_npdrm",
263265
"rsx_not_supported_feature",
266+
"vk_ext",
267+
"gl_ext",
264268
"verification_error_hex",
265269
"verification_error",
266270
"tty_line",

CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs

+4
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ internal partial class LogParser
277277
private static partial Regex UnsupportedDriverFeatures();
278278
[GeneratedRegex(@"RSX: Swapchain: present mode (?<rsx_swapchain_mode>\d+?) in use.+?\r?$", DefaultOptions)]
279279
private static partial Regex SwapchainMode();
280+
[GeneratedRegex(@"RSX: \*\* Using (?<vk_ext>\w+?)\r?$", DefaultOptions)]
281+
private static partial Regex VkExtensions();
282+
[GeneratedRegex(@"RSX: \[CAPS\] Using (?<gl_ext>\w+?)\r?$", DefaultOptions)]
283+
private static partial Regex GlExtensions();
280284
[GeneratedRegex(@"F \d+:\d+:\d+\.\d+ (({(?<fatal_error_context>[^}]+)} )?(\w+:\s*(Thread terminated due to fatal error: )?|(\w+:\s*)?(class [^\r\n]+ thrown: ))\r?\n?)(?<fatal_error>.*?)(\r?\n)(\r?\n|·|$)", DefaultSingleLine)]
281285
private static partial Regex FatalError();
282286
[GeneratedRegex(@"Failed to load RAP file: (?<rap_file>.*?\.rap).*\r?$", DefaultOptions)]

CompatBot/Utils/ResultFormatters/LogParserResultFormatter.WeirdSettingsSection.cs

+57-27
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,21 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, LogPa
7171
&& buildVersion >= IntelThreadSchedulerBuildVersion)
7272
notes.Add("ℹ️ Changing `Thread Scheduler` option may or may not increase performance");
7373
}
74+
var isAppleGpu = items["gpu_info"] is string gpuInfoApple && gpuInfoApple.Contains("Apple", StringComparison.OrdinalIgnoreCase);
75+
var canUseRelaxedZcull = items["renderer"] is not "Vulkan" || multiItems["vk_ext"].Contains("VK_EXT_depth_range_unrestricted");
7476
if (items["llvm_arch"] is string llvmArch)
7577
notes.Add($"❔ LLVM target CPU architecture override is set to `{llvmArch.Sanitize(replaceBackTicks: true)}`");
76-
77-
if (items["renderer"] == "D3D12")
78+
if (items["renderer"] is "D3D12")
7879
notes.Add("💢 Do **not** use DX12 renderer");
79-
if (items["renderer"] == "OpenGL"
80-
&& items["supported_gpu"] == EnabledMark
80+
if (items["renderer"] is "OpenGL"
81+
&& items["supported_gpu"] is EnabledMark
8182
&& !GowHDIds.Contains(serial))
8283
notes.Add("⚠️ `Vulkan` is the recommended `Renderer`");
83-
if (items["renderer"] == "Vulkan"
84-
&& items["supported_gpu"] == DisabledMark)
85-
notes.Add("❌ Selected `Vulkan` device is not supported, please use `OpenGL` instead");
84+
if (items["renderer"] is "Vulkan")
85+
{
86+
if (items["supported_gpu"] is DisabledMark)
87+
notes.Add("❌ Selected `Vulkan` device is not supported, please use `OpenGL` instead");
88+
}
8689
var selectedRes = items["resolution"];
8790
var selectedRatio = items["aspect_ratio"];
8891
if (!string.IsNullOrEmpty(selectedRes))
@@ -187,14 +190,16 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, LogPa
187190
&& buildVersion < RdnaMsaaFixedVersion
188191
&& RadeonRx5xxPattern().IsMatch(gpuInfo) // RX 590 is a thing 😔
189192
&& !gpuInfo.Contains("RADV");
190-
if (items["msaa"] == "Disabled")
193+
if (items["msaa"] is "Disabled")
191194
{
192-
if (!isWireframeBugPossible)
195+
if (!isWireframeBugPossible && !isAppleGpu)
193196
notes.Add("ℹ️ `Anti-aliasing` is disabled, which may result in visual artifacts");
194197
}
195-
else if (items["msaa"] is not null and not "Disabled")
198+
else if (items["msaa"] is not null)
196199
{
197-
if (isWireframeBugPossible)
200+
if (isAppleGpu)
201+
notes.Add("⚠️ `Anti-aliasing` is not supported for Apple GPUs, please disable");
202+
else if (isWireframeBugPossible)
198203
notes.Add("⚠️ Please disable `Anti-aliasing` if you experience wireframe-like visual artifacts");
199204
}
200205

@@ -239,9 +244,16 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, LogPa
239244
}
240245
if (items["async_texture_streaming"] == EnabledMark)
241246
{
242-
if (items["async_queue_scheduler"] == "Device")
243-
notes.Add("⚠️ If you experience visual artifacts, try setting `Async Queue Scheduler` to use `Host`");
244-
notes.Add("⚠️ If you experience visual artifacts, try disabling `Async Texture Streaming`");
247+
if (isAppleGpu)
248+
{
249+
notes.Add("⚠️ `Async Texture Streaming` is not supported on Apple GPUs");
250+
}
251+
else
252+
{
253+
if (items["async_queue_scheduler"] == "Device")
254+
notes.Add("⚠️ If you experience visual artifacts, try setting `Async Queue Scheduler` to use `Host`");
255+
notes.Add("⚠️ If you experience visual artifacts, try disabling `Async Texture Streaming`");
256+
}
245257
}
246258

247259
if (items["ppu_decoder"] is string ppuDecoder)
@@ -324,14 +336,24 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, LogPa
324336
if (items["cpu_blit"] is EnabledMark
325337
&& items["write_color_buffers"] is DisabledMark)
326338
notes.Add("❔ `Force CPU Blit` is enabled, but `Write Color Buffers` is disabled");
327-
if (items["zcull"] is EnabledMark)
339+
340+
if (items["zcull_status"] is not null and not "Full" && !canUseRelaxedZcull)
341+
notes.Add("⚠️ This GPU does not support `VK_EXT_depth_range_unrestricted` extension, please disable `Relaxed ZCull Sync`");
342+
else if (items["zcull_status"] is "Disabled")
328343
notes.Add("⚠️ `ZCull Occlusion Queries` is disabled, which can result in visual artifacts");
329344
else if (items["relaxed_zcull"] is string relaxedZcull)
330345
{
331-
if (relaxedZcull == EnabledMark && !KnownGamesThatWorkWithRelaxedZcull.Contains(serial))
346+
if (relaxedZcull is EnabledMark
347+
&& !KnownGamesThatWorkWithRelaxedZcull.Contains(serial))
348+
{
332349
notes.Add("ℹ️ `Relaxed ZCull Sync` is enabled and can cause performance and visual issues");
333-
else if (relaxedZcull == DisabledMark && KnownGamesThatWorkWithRelaxedZcull.Contains(serial))
350+
}
351+
else if (relaxedZcull is DisabledMark
352+
&& KnownGamesThatWorkWithRelaxedZcull.Contains(serial)
353+
&& canUseRelaxedZcull)
354+
{
334355
notes.Add("ℹ️ Enabling `Relaxed ZCull Sync` for this game may improve performance");
356+
}
335357
}
336358
if (!KnownFpsUnlockPatchIds.Contains(serial) || ppuPatches.Count == 0)
337359
{
@@ -426,15 +448,19 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, LogPa
426448
notes.Add("⚠️ `GPU Texture Scaling` is enabled, please disable");
427449
if (items["af_override"] is string af)
428450
{
429-
if (af == "Disabled")
451+
if (isAppleGpu && af is "Auto")
452+
notes.Add("⚠️ `Anisotropic Filter` override is not supported on Apple GPUs, please use `Auto`");
453+
else if (af is "Disabled")
430454
notes.Add("❌ `Anisotropic Filter` is `Disabled`, please use `Auto` instead");
431-
else if (af.ToLowerInvariant() != "auto" && af != "16")
455+
else if (af is not "auto" and not "16")
432456
notes.Add($"❔ `Anisotropic Filter` is set to `{af}x`, which makes little sense over `16x` or `Auto`");
433457
}
434458

435-
if (items["shader_mode"] == "Interpreter only")
459+
if (items["shader_mode"]?.Contains("Interpreter") is true && isAppleGpu)
460+
notes.Add("⚠️ Interpreter `Shader Mode` is not supported on Apple GPUs, please use Async-only option");
461+
else if (items["shader_mode"] == "Interpreter only")
436462
notes.Add("⚠️ `Shader Interpreter Only` mode is not accurate and very demanding");
437-
else if (items["shader_mode"]?.StartsWith("Async") is false)
463+
else if (items["shader_mode"]?.StartsWith("Async") is false && !isAppleGpu)
438464
notes.Add("❔ Async shader compilation is disabled");
439465
if (items["driver_recovery_timeout"] is string driverRecoveryTimeout
440466
&& int.TryParse(driverRecoveryTimeout, out var drtValue)
@@ -465,7 +491,9 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, LogPa
465491

466492
if (items["mtrsx"] is EnabledMark)
467493
{
468-
if (multiItems["fatal_error"].Any(f => f.Contains("VK_ERROR_OUT_OF_POOL_MEMORY_KHR")))
494+
if (isAppleGpu)
495+
notes.Add("⚠️ `Multithreaded RSX` is not supported for Apple GPUs");
496+
else if (multiItems["fatal_error"].Any(f => f.Contains("VK_ERROR_OUT_OF_POOL_MEMORY_KHR")))
469497
notes.Add("⚠️ `Multithreaded RSX` is enabled, please disable for this game");
470498
else if (threadCount < 6)
471499
notes.Add("⚠️ `Multithreaded RSX` is enabled on a CPU with few threads");
@@ -486,19 +514,21 @@ private static void BuildWeirdSettingsSection(DiscordEmbedBuilder builder, LogPa
486514
{
487515
if (buildVersion is not null && buildVersion < CubebBuildVersion)
488516
{
489-
if (items["os_type"] is "Windows" && !audioBackend.Equals("XAudio2", StringComparison.InvariantCultureIgnoreCase))
517+
if (items["os_type"] is "Windows" && !audioBackend.Equals("XAudio2", StringComparison.OrdinalIgnoreCase))
490518
notes.Add("⚠️ Please use `XAudio2` as the audio backend for this build");
491519
else if (items["os_type"] == "Linux"
492-
&& !audioBackend.Equals("OpenAL", StringComparison.InvariantCultureIgnoreCase)
493-
&& !audioBackend.Equals("FAudio", StringComparison.InvariantCultureIgnoreCase))
520+
&& !audioBackend.Equals("OpenAL", StringComparison.OrdinalIgnoreCase)
521+
&& !audioBackend.Equals("FAudio", StringComparison.OrdinalIgnoreCase))
494522
notes.Add("ℹ️ `FAudio` and `OpenAL` are the recommended audio backends for this build");
495523
}
496524
else
497525
{
498-
if (items["os_type"] is "Windows" or "Linux" && !audioBackend.Equals("Cubeb", StringComparison.InvariantCultureIgnoreCase))
526+
if (items["os_type"] is "Windows" or "Linux"
527+
&& !audioBackend.Equals("Cubeb", StringComparison.OrdinalIgnoreCase)
528+
&& !audioBackend.Equals("XAudio2", StringComparison.OrdinalIgnoreCase))
499529
notes.Add("⚠️ Please use `Cubeb` as the audio backend");
500530
}
501-
if (audioBackend.Equals("null", StringComparison.InvariantCultureIgnoreCase))
531+
if (audioBackend.Equals("null", StringComparison.OrdinalIgnoreCase))
502532
notes.Add("⚠️ `Audio backend` is set to `null`");
503533
}
504534

CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs

+2
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,8 @@ private static void CleanupValues(LogParseState state)
651651
items["shader_mode"] = "Async";
652652
else if (items["disable_async_shaders"] is EnabledMark or "true")
653653
items["shader_mode"] = "Recompiler only";
654+
if (items["rsx_fifo_mode"] is string rsxfm && rsxfm.StartsWith('"') && rsxfm.EndsWith('"'))
655+
items["rsx_fifo_mode"] = rsxfm[1..^1];
654656
if (items["cpu_preempt_count"] is "0")
655657
items["cpu_preempt_count"] = "Disabled";
656658

0 commit comments

Comments
 (0)