From a60f2384795e4e7d7d18439e91bab0e5ae53f1ba Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Tue, 26 Oct 2021 20:05:28 +0530 Subject: [PATCH] Fix `GPU::DebugCallback` Type String Extraction The second parameter of `std::string_view::substr` was assumed to be an end position (similar to `std::span`) rather than `count` which it is. As a result of this, it was entirely broken but only held together by a constant factor being subtracted from it which was derived by trial and error. It's now been fixed by returning a count rather than the absolute position. --- app/src/main/cpp/skyline/gpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/gpu.cpp b/app/src/main/cpp/skyline/gpu.cpp index 3a0f23f1..203d7e0e 100644 --- a/app/src/main/cpp/skyline/gpu.cpp +++ b/app/src/main/cpp/skyline/gpu.cpp @@ -100,7 +100,7 @@ namespace skyline::gpu { auto first{type.find('[')}; auto last{type.find(']', first)}; if (first != std::string_view::npos && last != std::string_view::npos) { - type = type.substr(first + 2, last != std::string_view::npos ? last - 4 : last); + type = type.substr(first + 2, last != std::string_view::npos ? (last - first) - 3 : last); switch (util::Hash(type)) { IGNORE_VALIDATION("UNASSIGNED-CoreValidation-SwapchainPreTransform"); // We handle transformation via Android APIs directly