From 4e9f7119c51df0bec38080af234ff6a22f3e649e Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Mon, 18 Dec 2023 23:28:40 +0100 Subject: [PATCH] early-access version 4025 --- README.md | 2 +- src/core/hle/service/filesystem/filesystem.h | 7 +++++++ src/core/hle/service/filesystem/fsp_srv.cpp | 18 +++++++++------- src/shader_recompiler/ir_opt/texture_pass.cpp | 21 +++++++------------ .../renderer_vulkan/vk_query_cache.cpp | 9 +++++--- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 54c77ae51..99f758c75 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 4024. +This is the source code for early-access 4025. ## Legal Notice diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index c0502f4aa..cc096a957 100755 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -54,6 +54,13 @@ enum class ImageDirectoryId : u32 { SdCard, }; +enum class OpenDirectoryMode : u64 { + Directory = (1 << 0), + File = (1 << 1), + All = Directory | File +}; +DECLARE_ENUM_FLAG_OPERATORS(OpenDirectoryMode); + class FileSystemController { public: explicit FileSystemController(Core::System& system_); diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 009e1b043..e09e4361a 100755 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -259,7 +259,7 @@ static void BuildEntryIndex(std::vector& entries, const std::vec class IDirectory final : public ServiceFramework { public: - explicit IDirectory(Core::System& system_, FileSys::VirtualDir backend_) + explicit IDirectory(Core::System& system_, FileSys::VirtualDir backend_, OpenDirectoryMode mode) : ServiceFramework{system_, "IDirectory"}, backend(std::move(backend_)) { static const FunctionInfo functions[] = { {0, &IDirectory::Read, "Read"}, @@ -269,8 +269,12 @@ public: // TODO(DarkLordZach): Verify that this is the correct behavior. // Build entry index now to save time later. - BuildEntryIndex(entries, backend->GetFiles(), FileSys::EntryType::File); - BuildEntryIndex(entries, backend->GetSubdirectories(), FileSys::EntryType::Directory); + if (True(mode & OpenDirectoryMode::Directory)) { + BuildEntryIndex(entries, backend->GetSubdirectories(), FileSys::EntryType::Directory); + } + if (True(mode & OpenDirectoryMode::File)) { + BuildEntryIndex(entries, backend->GetFiles(), FileSys::EntryType::File); + } } private: @@ -446,11 +450,9 @@ public: const auto file_buffer = ctx.ReadBuffer(); const std::string name = Common::StringFromBuffer(file_buffer); + const auto mode = rp.PopRaw(); - // TODO(Subv): Implement this filter. - const u32 filter_flags = rp.Pop(); - - LOG_DEBUG(Service_FS, "called. directory={}, filter={}", name, filter_flags); + LOG_DEBUG(Service_FS, "called. directory={}, mode={}", name, mode); FileSys::VirtualDir vfs_dir{}; auto result = backend.OpenDirectory(&vfs_dir, name); @@ -460,7 +462,7 @@ public: return; } - auto directory = std::make_shared(system, vfs_dir); + auto directory = std::make_shared(system, vfs_dir, mode); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(ResultSuccess); diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index 29a887dd1..9ce917c62 100755 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -538,6 +538,14 @@ 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) { @@ -654,19 +662,6 @@ 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; - } } } diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 189ef5e0c..d33ab1c27 100755 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -289,12 +289,15 @@ public: } if (has_multi_queries) { - size_t intermediary_buffer_index = ObtainBuffer(num_slots_used); + const size_t min_accumulation_limit = + std::min(first_accumulation_checkpoint, num_slots_used); + const size_t max_accumulation_limit = + std::max(last_accumulation_checkpoint, num_slots_used); + const size_t intermediary_buffer_index = ObtainBuffer(num_slots_used); resolve_buffers.push_back(intermediary_buffer_index); queries_prefix_scan_pass->Run(*accumulation_buffer, *buffers[intermediary_buffer_index], *buffers[resolve_buffer_index], num_slots_used, - std::min(first_accumulation_checkpoint, num_slots_used), - last_accumulation_checkpoint); + min_accumulation_limit, max_accumulation_limit); } else { scheduler.RequestOutsideRenderPassOperationContext();