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.
This commit is contained in:
PixelyIon 2021-10-26 20:05:28 +05:30
parent 10ed5bf418
commit a60f238479

View File

@ -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