Merge branch 'shadps4-emu:main' into Inv-Godess

This commit is contained in:
Dmugetsu 2024-09-06 04:19:23 -06:00 committed by GitHub
commit 0216afcae1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 43 deletions

View File

@ -145,7 +145,7 @@ int PS4_SYSV_ABI sceKernelPollEventFlag(OrbisKernelEventFlag ef, u64 bitPattern,
} }
int PS4_SYSV_ABI sceKernelWaitEventFlag(OrbisKernelEventFlag ef, u64 bitPattern, u32 waitMode, int PS4_SYSV_ABI sceKernelWaitEventFlag(OrbisKernelEventFlag ef, u64 bitPattern, u32 waitMode,
u64* pResultPat, OrbisKernelUseconds* pTimeout) { u64* pResultPat, OrbisKernelUseconds* pTimeout) {
LOG_INFO(Kernel_Event, "called bitPattern = {:#x} waitMode = {:#x}", bitPattern, waitMode); LOG_DEBUG(Kernel_Event, "called bitPattern = {:#x} waitMode = {:#x}", bitPattern, waitMode);
if (ef == nullptr) { if (ef == nullptr) {
return ORBIS_KERNEL_ERROR_ESRCH; return ORBIS_KERNEL_ERROR_ESRCH;
} }

View File

@ -272,7 +272,7 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
int* numEntriesOut, int flags) { int* numEntriesOut, int flags) {
int result = ORBIS_OK; int result = ORBIS_OK;
int processed = 0; int processed = 0;
for (int i = 0; i < numEntries; i++) { for (int i = 0; i < numEntries; i++, processed++) {
if (entries == nullptr || entries[i].length == 0 || entries[i].operation > 4) { if (entries == nullptr || entries[i].length == 0 || entries[i].operation > 4) {
result = ORBIS_KERNEL_ERROR_EINVAL; result = ORBIS_KERNEL_ERROR_EINVAL;
break; // break and assign a value to numEntriesOut. break; // break and assign a value to numEntriesOut.
@ -292,41 +292,16 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
} }
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_UNMAP: { case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_UNMAP: {
result = sceKernelMunmap(entries[i].start, entries[i].length); result = sceKernelMunmap(entries[i].start, entries[i].length);
LOG_INFO(Kernel_Vmm, "BatchMap: entry = {}, operation = {}, len = {:#x}, result = {}", LOG_INFO(Kernel_Vmm, "entry = {}, operation = {}, len = {:#x}, result = {}", i,
i, entries[i].operation, entries[i].length, result); entries[i].operation, entries[i].length, result);
break;
if (result == 0)
processed++;
} }
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_PROTECT: { case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_PROTECT: {
result = sceKernelMProtect(entries[i].start, entries[i].length, entries[i].protection); result = sceKernelMProtect(entries[i].start, entries[i].length, entries[i].protection);
LOG_INFO(Kernel_Vmm, "BatchMap: entry = {}, operation = {}, len = {:#x}, result = {}", LOG_INFO(Kernel_Vmm, "entry = {}, operation = {}, len = {:#x}, result = {}", i,
i, entries[i].operation, entries[i].length, result); entries[i].operation, entries[i].length, result);
if (result != ORBIS_OK) {
LOG_ERROR(Kernel_Vmm, "BatchMap: MProtect failed on entry {} with result {}", i,
result);
}
if (result == 0) {
processed++;
}
break; break;
} }
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_TYPE_PROTECT: {
result = sceKernelMTypeProtect(entries[i].start, entries[i].length, entries[i].type,
entries[i].protection);
LOG_INFO(Kernel_Vmm, "BatchMap: entry = {}, operation = {}, len = {:#x}, result = {}",
i, entries[i].operation, entries[i].length, result);
if (result != ORBIS_OK) {
LOG_ERROR(Kernel_Vmm, "BatchMap: MProtect failed on entry {} with result {}", i,
result);
}
if (result == 0) {
processed++;
}
break;
}
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_FLEXIBLE: { case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_FLEXIBLE: {
result = sceKernelMapNamedFlexibleMemory(&entries[i].start, entries[i].length, result = sceKernelMapNamedFlexibleMemory(&entries[i].start, entries[i].length,
entries[i].protection, flags, ""); entries[i].protection, flags, "");
@ -336,7 +311,13 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
i, entries[i].operation, entries[i].length, (u8)entries[i].type, result); i, entries[i].operation, entries[i].length, (u8)entries[i].type, result);
break; break;
} }
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_TYPE_PROTECT: {
result = sceKernelMTypeProtect(entries[i].start, entries[i].length, entries[i].type,
entries[i].protection);
LOG_INFO(Kernel_Vmm, "entry = {}, operation = {}, len = {:#x}, result = {}", i,
entries[i].operation, entries[i].length, result);
break;
}
default: { default: {
UNREACHABLE(); UNREACHABLE();
} }
@ -346,8 +327,6 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
break; break;
} }
} }
LOG_INFO(Kernel_Vmm, "sceKernelBatchMap2 finished: processed = {}, result = {}", processed,
result);
if (numEntriesOut != NULL) { // can be zero. do not return an error code. if (numEntriesOut != NULL) { // can be zero. do not return an error code.
*numEntriesOut = processed; *numEntriesOut = processed;
} }

View File

@ -145,14 +145,6 @@ const GraphicsPipeline* PipelineCache::GetGraphicsPipeline() {
LOG_TRACE(Render_Vulkan, "FMask decompression pass skipped"); LOG_TRACE(Render_Vulkan, "FMask decompression pass skipped");
return nullptr; return nullptr;
} }
if (regs.depth_render_control.depth_compress_disable) {
LOG_TRACE(Render_Vulkan, "HTile decompress skipped (depth)");
return nullptr;
}
if (regs.depth_render_control.stencil_compress_disable) {
LOG_TRACE(Render_Vulkan, "HTile decompress skipped (stencil)");
return nullptr;
}
if (!RefreshGraphicsKey()) { if (!RefreshGraphicsKey()) {
return nullptr; return nullptr;
} }
@ -300,6 +292,11 @@ bool PipelineCache::RefreshGraphicsKey() {
} }
const auto stage = Shader::StageFromIndex(i); const auto stage = Shader::StageFromIndex(i);
const auto params = Liverpool::GetParams(*pgm); const auto params = Liverpool::GetParams(*pgm);
if (stage != Shader::Stage::Vertex && stage != Shader::Stage::Fragment) {
return false;
}
std::tie(infos[i], modules[i], key.stage_hashes[i]) = GetProgram(stage, params, binding); std::tie(infos[i], modules[i], key.stage_hashes[i]) = GetProgram(stage, params, binding);
} }
return true; return true;