mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-07 09:31:31 -06:00
Merge branch 'main' into ime-fixes-again
This commit is contained in:
commit
fef9912088
@ -14,12 +14,6 @@
|
||||
|
||||
namespace Libraries::Kernel {
|
||||
|
||||
constexpr int PthreadInheritSched = 4;
|
||||
|
||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_DEFAULT = 700;
|
||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_HIGHEST = 256;
|
||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_LOWEST = 767;
|
||||
|
||||
extern PthreadAttr PthreadAttrDefault;
|
||||
|
||||
void _thread_cleanupspecific();
|
||||
@ -231,7 +225,7 @@ int PS4_SYSV_ABI posix_pthread_create_name_np(PthreadT* thread, const PthreadAtt
|
||||
new_thread->attr = *(*attr);
|
||||
new_thread->attr.cpusetsize = 0;
|
||||
}
|
||||
if (new_thread->attr.sched_inherit == PthreadInheritSched) {
|
||||
if (curthread != nullptr && new_thread->attr.sched_inherit == PthreadInheritSched) {
|
||||
if (True(curthread->attr.flags & PthreadAttrFlags::ScopeSystem)) {
|
||||
new_thread->attr.flags |= PthreadAttrFlags::ScopeSystem;
|
||||
} else {
|
||||
|
||||
@ -24,6 +24,12 @@ class SymbolsResolver;
|
||||
|
||||
namespace Libraries::Kernel {
|
||||
|
||||
constexpr int PthreadInheritSched = 4;
|
||||
|
||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_DEFAULT = 700;
|
||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_HIGHEST = 256;
|
||||
constexpr int ORBIS_KERNEL_PRIO_FIFO_LOWEST = 767;
|
||||
|
||||
struct Pthread;
|
||||
|
||||
enum class PthreadMutexFlags : u32 {
|
||||
|
||||
@ -24,9 +24,9 @@ static constexpr std::array<PthreadPrio, 3> ThrPriorities = {{
|
||||
}};
|
||||
|
||||
PthreadAttr PthreadAttrDefault = {
|
||||
.sched_policy = SchedPolicy::Fifo,
|
||||
.sched_inherit = 0,
|
||||
.prio = 0,
|
||||
.sched_policy = SchedPolicy::Other,
|
||||
.sched_inherit = PthreadInheritSched,
|
||||
.prio = ORBIS_KERNEL_PRIO_FIFO_DEFAULT,
|
||||
.suspend = false,
|
||||
.flags = PthreadAttrFlags::ScopeSystem,
|
||||
.stackaddr_attr = nullptr,
|
||||
|
||||
@ -564,13 +564,12 @@ void EmitContext::DefineVertexBlock() {
|
||||
const bool needs_clip_distance_emulation = l_stage == LogicalStage::Vertex &&
|
||||
stage == Stage::Vertex &&
|
||||
profile.needs_clip_distance_emulation;
|
||||
if (!needs_clip_distance_emulation) {
|
||||
if (info.stores.GetAny(IR::Attribute::ClipDistance)) {
|
||||
const Id type{TypeArray(F32[1], ConstU32(8U))};
|
||||
const Id initializer{ConstantComposite(type, zero)};
|
||||
clip_distances = DefineVariable(type, spv::BuiltIn::ClipDistance,
|
||||
spv::StorageClass::Output, initializer);
|
||||
}
|
||||
const auto has_clip_distance_outputs = info.stores.GetAny(IR::Attribute::ClipDistance);
|
||||
if (has_clip_distance_outputs && !needs_clip_distance_emulation) {
|
||||
const Id type{TypeArray(F32[1], ConstU32(8U))};
|
||||
const Id initializer{ConstantComposite(type, zero)};
|
||||
clip_distances = DefineVariable(type, spv::BuiltIn::ClipDistance, spv::StorageClass::Output,
|
||||
initializer);
|
||||
}
|
||||
if (info.stores.GetAny(IR::Attribute::CullDistance)) {
|
||||
const Id type{TypeArray(F32[1], ConstU32(8U))};
|
||||
@ -603,7 +602,9 @@ void EmitContext::DefineOutputs() {
|
||||
Name(output_attr_array, "out_attrs");
|
||||
}
|
||||
} else {
|
||||
const auto has_clip_distance_outputs = info.stores.GetAny(IR::Attribute::ClipDistance);
|
||||
const bool needs_clip_distance_emulation =
|
||||
stage == Stage::Vertex && profile.needs_clip_distance_emulation &&
|
||||
info.stores.GetAny(IR::Attribute::ClipDistance);
|
||||
u32 num_attrs = 0u;
|
||||
for (u32 i = 0; i < IR::NumParams; i++) {
|
||||
const IR::Attribute param{IR::Attribute::Param0 + i};
|
||||
@ -612,14 +613,14 @@ void EmitContext::DefineOutputs() {
|
||||
}
|
||||
const u32 num_components = info.stores.NumComponents(param);
|
||||
const Id id{
|
||||
DefineOutput(F32[num_components], i + (has_clip_distance_outputs ? 1 : 0))};
|
||||
DefineOutput(F32[num_components], i + (needs_clip_distance_emulation ? 1 : 0))};
|
||||
Name(id, fmt::format("out_attr{}", i));
|
||||
output_params[i] =
|
||||
GetAttributeInfo(AmdGpu::NumberFormat::Float, id, num_components, true);
|
||||
++num_attrs;
|
||||
}
|
||||
|
||||
if (has_clip_distance_outputs) {
|
||||
if (needs_clip_distance_emulation) {
|
||||
clip_distances = Id{DefineOutput(F32[MaxEmulatedClipDistances], 0)};
|
||||
output_params[num_attrs] = GetAttributeInfo(
|
||||
AmdGpu::NumberFormat::Float, clip_distances, MaxEmulatedClipDistances, true);
|
||||
|
||||
@ -1015,6 +1015,10 @@ bool Rasterizer::IsMapped(VAddr addr, u64 size) {
|
||||
// There is no memory, so not mapped.
|
||||
return false;
|
||||
}
|
||||
if (static_cast<u64>(addr) > std::numeric_limits<u64>::max() - size) {
|
||||
// Memory range wrapped the address space, cannot be mapped.
|
||||
return false;
|
||||
}
|
||||
const auto range = decltype(mapped_ranges)::interval_type::right_open(addr, addr + size);
|
||||
|
||||
Common::RecursiveSharedLock lock{mapped_ranges_mutex};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user