From 4b3810cf0b560ecea2f900602b3bf294fa3ea82f Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Mon, 18 Dec 2023 03:05:14 +0100 Subject: [PATCH] early-access version 4024 --- README.md | 2 +- src/common/fs/path_util.cpp | 6 +++--- src/common/fs/path_util.h | 2 +- src/shader_recompiler/ir_opt/texture_pass.cpp | 21 ++++++++++++------- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index bd7668817..54c77ae51 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 4023. +This is the source code for early-access 4024. ## Legal Notice diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index cf459621c..ade1706db 100755 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp @@ -418,9 +418,9 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se return std::string(RemoveTrailingSlash(path)); } -std::string_view GetParentPath(std::string_view path) { +std::string GetParentPath(std::string_view path) { if (path.empty()) { - return path; + return std::string(path); } #ifdef ANDROID @@ -439,7 +439,7 @@ std::string_view GetParentPath(std::string_view path) { name_index = std::max(name_bck_index, name_fwd_index); } - return path.substr(0, name_index); + return std::string(path.substr(0, name_index)); } std::string_view GetPathWithoutTop(std::string_view path) { diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index affb467a4..489b66c14 100755 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h @@ -302,7 +302,7 @@ enum class DirectorySeparator { DirectorySeparator directory_separator = DirectorySeparator::ForwardSlash); // Gets all of the text up to the last '/' or '\' in the path. -[[nodiscard]] std::string_view GetParentPath(std::string_view path); +[[nodiscard]] std::string GetParentPath(std::string_view path); // Gets all of the text after the first '/' or '\' in the path. [[nodiscard]] std::string_view GetPathWithoutTop(std::string_view path); diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index 9ce917c62..29a887dd1 100755 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -538,14 +538,6 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo flags.type.Assign(ReadTextureType(env, cbuf)); inst->SetFlags(flags); break; - case IR::Opcode::ImageSampleImplicitLod: - if (flags.type != TextureType::Color2D) { - break; - } - if (ReadTextureType(env, cbuf) == TextureType::Color2DRect) { - PatchImageSampleImplicitLod(*texture_inst.block, *texture_inst.inst); - } - break; case IR::Opcode::ImageFetch: if (flags.type == TextureType::Color2D || flags.type == TextureType::Color2DRect || flags.type == TextureType::ColorArray2D) { @@ -662,6 +654,19 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo PatchTexelFetch(*texture_inst.block, *texture_inst.inst, pixel_format); } } + + switch (inst->GetOpcode()) { + case IR::Opcode::ImageSampleImplicitLod: + if (flags.type != TextureType::Color2D) { + break; + } + if (ReadTextureType(env, cbuf) == TextureType::Color2DRect) { + PatchImageSampleImplicitLod(*texture_inst.block, *texture_inst.inst); + } + break; + default: + break; + } } }