diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp index 6319b7c2..8812095f 100644 --- a/src/core/libraries/kernel/thread_management.cpp +++ b/src/core/libraries/kernel/thread_management.cpp @@ -1064,7 +1064,16 @@ ScePthread PThreadPool::Create() { } } +#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/core/libraries/network/net.cpp b/src/core/libraries/network/net.cpp index 2c03dde3..d5fa1b6b 100644 --- a/src/core/libraries/network/net.cpp +++ b/src/core/libraries/network/net.cpp @@ -10,6 +10,7 @@ #include #endif +#include #include "common/assert.h" #include "common/logging/log.h" #include "core/libraries/error_codes.h" @@ -59,6 +60,7 @@ int PS4_SYSV_ABI sce_net_in6addr_nodelocal_allnodes() { } OrbisNetId PS4_SYSV_ABI sceNetAccept(OrbisNetId s, OrbisNetSockaddr* addr, u32* paddrlen) { + std::this_thread::sleep_for(std::chrono::seconds(5)); LOG_ERROR(Lib_Net, "(STUBBED) called"); return ORBIS_OK; } diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index 0fec0c2f..8b18657d 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -103,7 +103,8 @@ void CFG::EmitDivergenceLabels() { // Sometimes compiler might insert instructions between the SAVEEXEC and the branch. // Those instructions need to be wrapped in the condition as well so allow branch // as end scope instruction. - inst.opcode == Opcode::S_CBRANCH_EXECZ; + inst.opcode == Opcode::S_CBRANCH_EXECZ || + inst.opcode == Opcode::S_ANDN2_B64; }; // Since we will be adding new labels, avoid iterating those as well. @@ -120,23 +121,12 @@ void CFG::EmitDivergenceLabels() { s32 curr_begin = -1; for (size_t index = GetIndex(start); index < end_index; index++) { const auto& inst = inst_list[index]; - // Mark a potential start of an exec scope. - if (is_open_scope(inst)) { - curr_begin = index; - continue; - } if (is_close_scope(inst) && curr_begin != -1) { // If there are no instructions inside scope don't do anything. if (index - curr_begin == 1) { curr_begin = -1; continue; } - // Ensure the register holding EXEC is the same as the one saved. - const u32 backup_sreg = inst_list[curr_begin].dst[0].code; - const u32 restore_sreg = inst.src[0].code; - if (inst.opcode == Opcode::S_MOV_B64 && backup_sreg != restore_sreg) { - continue; - } // Add a label to the instruction right after the open scope call. // It is the start of a new basic block. const auto& save_inst = inst_list[curr_begin]; @@ -144,13 +134,21 @@ void CFG::EmitDivergenceLabels() { AddLabel(label); // Add a label to the close scope instruction as well. AddLabel(index_to_pc[index]); + // Reset scope begin. curr_begin = -1; } + // Mark a potential start of an exec scope. + if (is_open_scope(inst)) { + curr_begin = index; + } } } // Sort labels to make sure block insertion is correct. std::ranges::sort(labels); + for (const auto label : labels) { + LOG_INFO(Render_Vulkan, "Emitting label {:#x}", label); + } } void CFG::EmitBlocks() { @@ -167,7 +165,7 @@ void CFG::EmitBlocks() { const Label end = *next_it; const size_t end_index = GetIndex(end) - 1; const auto& end_inst = inst_list[end_index]; - + LOG_INFO(Render_Vulkan, "Emitting block {:#x}-{:#x}", start, end); // Insert block between the labels using the last instruction // as an indicator for branching type. Block* block = block_pool.Create(); diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index dce2d4b4..1172af24 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -180,6 +180,10 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::spantype3.NumWords(); const PM4ItOpcode opcode = header->type3.opcode; switch (opcode) { diff --git a/src/video_core/buffer_cache/buffer_cache.cpp b/src/video_core/buffer_cache/buffer_cache.cpp index 02d6b2ce..ad111cdc 100644 --- a/src/video_core/buffer_cache/buffer_cache.cpp +++ b/src/video_core/buffer_cache/buffer_cache.cpp @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later - +#pragma clang optimize off #include #include "common/alignment.h" #include "common/scope_exit.h" diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index f44880d3..64522e8f 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -114,7 +114,7 @@ bool ComputePipeline::BindResources(VideoCore::BufferCache& buffer_cache, } } const u32 size = vsharp.GetSize(); - if (buffer.is_written && compute_key != 0xe991ee280187cbc) { + if (buffer.is_written && compute_key != 0xe991ee280187cbc && compute_key != 0xfefebf9f) { texture_cache.InvalidateMemory(address, size, true); } const u32 alignment =