From dd0773dfb1090e61bcee38efd713fe420b305bda Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 23:50:39 +0300 Subject: [PATCH] touchups --- src/core/libraries/kernel/thread_management.cpp | 9 --------- src/shader_recompiler/frontend/control_flow_graph.cpp | 8 +++++++- src/video_core/renderer_vulkan/vk_pipeline_common.cpp | 3 ++- src/video_core/renderer_vulkan/vk_pipeline_common.h | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp index a658245e..2a44f853 100644 --- a/src/core/libraries/kernel/thread_management.cpp +++ b/src/core/libraries/kernel/thread_management.cpp @@ -1069,16 +1069,7 @@ ScePthread PThreadPool::Create(const char* name) { } } -#ifdef _WIN64 auto* ret = new PthreadInternal{}; -#else - // TODO: Linux specific hack - static u8* hint_address = reinterpret_cast(0x7FFFFC000ULL); - auto* ret = reinterpret_cast( - mmap(hint_address, sizeof(PthreadInternal), PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0)); - hint_address += Common::AlignUp(sizeof(PthreadInternal), 4_KB); -#endif ret->is_free = false; ret->is_detached = false; ret->is_almost_done = false; diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index c7bd9d84..9d481d32 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -138,7 +138,13 @@ void CFG::EmitDivergenceLabels() { const auto& save_inst = inst_list[curr_begin]; const Label label = index_to_pc[curr_begin] + save_inst.length; AddLabel(label); - // Add a label to the close scope instruction as well. + // Add a label to the close scope instruction. + // There are 3 cases where we need to close a scope. + // * Close scope instruction inside the block + // * Close scope instruction at the end of the block (cbranch or endpgm) + // * Normal instruction at the end of the block + // For the last case we must NOT add a label as that would cause + // the instruction to be separated into its own basic block. if (is_close) { AddLabel(index_to_pc[index]); } diff --git a/src/video_core/renderer_vulkan/vk_pipeline_common.cpp b/src/video_core/renderer_vulkan/vk_pipeline_common.cpp index 9d611a83..61e56415 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_common.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_common.cpp @@ -20,7 +20,8 @@ Pipeline::Pipeline(const Instance& instance_, Scheduler& scheduler_, DescriptorH Pipeline::~Pipeline() = default; void Pipeline::BindTextures(VideoCore::TextureCache& texture_cache, const Shader::Info& stage, - Shader::Backend::Bindings& binding, DescriptorWrites& set_writes) const { + Shader::Backend::Bindings& binding, + DescriptorWrites& set_writes) const { using ImageBindingInfo = std::tuple; boost::container::static_vector image_bindings; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_common.h b/src/video_core/renderer_vulkan/vk_pipeline_common.h index 704a49aa..ab99e7b3 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_common.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_common.h @@ -3,8 +3,8 @@ #pragma once -#include "shader_recompiler/info.h" #include "shader_recompiler/backend/bindings.h" +#include "shader_recompiler/info.h" #include "video_core/renderer_vulkan/vk_common.h" namespace VideoCore {