Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287)

Removes the -DPUBLIC_RELEASE flag. Cemu's debug asserts are now only enabled if the build configuration is Debug. Similarly, on Windows the console is only shown for Debug builds.
This commit is contained in:
Exzap
2022-09-24 08:43:27 +02:00
committed by GitHub
parent b720d17a97
commit 3bceb39966
68 changed files with 154 additions and 186 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ jobs:
if: ${{ inputs.deploymode == 'release' }}
run: |
echo "BUILD_MODE=release" >> $GITHUB_ENV
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" >> $GITHUB_ENV
echo "BUILD_FLAGS=" >> $GITHUB_ENV
echo "Build mode is release"
- name: Setup debug mode parameters (for continous build)
if: ${{ inputs.deploymode != 'release' }}
@@ -99,7 +99,7 @@ jobs:
if: ${{ inputs.deploymode == 'release' }}
run: |
echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "Build mode is release"
- name: Setup debug mode parameters (for continous build)
@@ -173,7 +173,7 @@ jobs:
if: ${{ inputs.deploymode == 'release' }}
run: |
echo "BUILD_MODE=release" >> $GITHUB_ENV
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" >> $GITHUB_ENV
echo "BUILD_FLAGS=" >> $GITHUB_ENV
echo "Build mode is release"
- name: Setup debug mode parameters (for continous build)
if: ${{ inputs.deploymode != 'release' }}
+3 -3
View File
@@ -30,7 +30,7 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required
*Additionally, for Ubuntu 22.04 only:*
- `sudo apt install -y clang-12`
- At step 3 while building, use
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DPUBLIC_RELEASE=ON -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`
#### For Arch and derivatives:
`sudo pacman -S git cmake clang ninja nasm base-devel linux-headers gtk3 libsecret libgcrypt systemd freeglut zip unzip libpulse`
@@ -41,14 +41,14 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required
### Build Cemu using cmake and clang
1. `git clone --recursive https://github.com/cemu-project/Cemu`
2. `cd Cemu`
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DPUBLIC_RELEASE=ON -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja`
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja`
4. `cmake --build build`
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
#### Using GCC
While we use and test Cemu using clang, using GCC might work better with your distro (they should be fairly similar performance/issues wise and should only be considered if compilation is the issue).
You can use it by replacing the step 3 with the following:
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DPUBLIC_RELEASE=ON -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja`
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja`
#### Troubleshooting steps
- If step 3 gives you an error about not being able to find ninja, try appending `-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja` to the command and running it again.
+8 -9
View File
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.21.1)
option(PUBLIC_RELEASE "Compile with debug asserts disabled and no console" OFF)
option(ENABLE_VCPKG "Enable the vcpkg package manager" ON)
set(EXPERIMENTAL_VERSION "" CACHE STRING "") # used by CI script to set experimental version
@@ -29,13 +28,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (PUBLIC_RELEASE)
add_compile_definitions(PUBLIC_RELEASE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) # enable LTO
endif()
add_compile_definitions($<$<CONFIG:Debug>:CEMU_DEBUG_ASSERT>) # if build type is debug, set CEMU_DEBUG_ASSERT
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# enable link time optimization for release builds
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON)
if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin)
# floating point model: precise, fiber safe optimizations
@@ -48,10 +48,9 @@ if (MSVC)
else()
add_compile_options(/GT)
endif()
if (PUBLIC_RELEASE)
message(STATUS "Using additional optimization flags for MSVC")
add_compile_options(/Oi /Ot) # enable intrinsic functions, favor speed
endif()
# enable additional optimization flags for release builds
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Oi>) # enable intrinsic functions
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Ot>) # favor speed
endif()
if (APPLE)
+3 -4
View File
@@ -1,7 +1,7 @@
{
"configurations": [
{
"name": "Release",
"name": "RelWithDebInfo",
"configurationType": "RelWithDebInfo",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
@@ -9,13 +9,12 @@
"installRoot": "${projectDir}\\out\\install\\${name}"
},
{
"name": "Public Release",
"configurationType": "RelWithDebInfo",
"name": "Release",
"configurationType": "Release",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DPUBLIC_RELEASE=ON"
},
{
"name": "Debug",
+1 -1
View File
@@ -1,2 +1,2 @@
"C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -B build/ -DPUBLIC_RELEASE=ON
"C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -B build/
pause
+5 -11
View File
@@ -54,17 +54,10 @@ add_subdirectory(imgui)
add_subdirectory(resource)
add_subdirectory(asm)
if(PUBLIC_RELEASE)
add_executable(CemuBin WIN32
main.cpp
mainLLE.cpp
)
else()
add_executable(CemuBin
main.cpp
mainLLE.cpp
)
endif()
add_executable(CemuBin
main.cpp
mainLLE.cpp
)
if(WIN32)
target_sources(CemuBin PRIVATE
@@ -73,6 +66,7 @@ if(WIN32)
endif()
set_property(TARGET CemuBin PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET CemuBin PROPERTY WIN32_EXECUTABLE $<NOT:$<CONFIG:Debug>>)
set_target_properties(CemuBin PROPERTIES
# multi-configuration generators will add a config subdirectory to RUNTIME_OUTPUT_DIRECTORY if no generator expression is used
+5 -5
View File
@@ -199,7 +199,7 @@ MPTR hle_locate(uint8* data, uint8* mask, sint32 dataLength)
}
else
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (mask[0] != 0xFF)
assert_dbg();
#endif
@@ -299,7 +299,7 @@ void GamePatch_scan()
hleAddr = hle_locate(xcx_gpuHangDetection_degradeFramebuffer, NULL, sizeof(xcx_gpuHangDetection_degradeFramebuffer));
if( hleAddr )
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: XCX GPU hang detection");
#endif
// remove the ADDI r25, r25, 1 instruction
@@ -309,7 +309,7 @@ void GamePatch_scan()
hleAddr = hle_locate(xcx_framebufferReductionSignature, xcx_framebufferReductionMask, sizeof(xcx_framebufferReductionSignature));
if( hleAddr )
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: Prevent XCX rendertarget reduction");
#endif
uint32 bl = memory_readU32(hleAddr+0x14);
@@ -325,7 +325,7 @@ void GamePatch_scan()
hleAddr = hle_locate(botw_busyLoopSignature, botw_busyLoopMask, sizeof(botw_busyLoopSignature));
if (hleAddr)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: Patch BotW busy loop 1 at 0x%08x", hleAddr);
#endif
sint32 functionIndex = hleIndex_h000000001;
@@ -336,7 +336,7 @@ void GamePatch_scan()
hleAddr = hle_locate(botw_busyLoopSignature2, botw_busyLoopMask2, sizeof(botw_busyLoopSignature2));
if (hleAddr)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: Patch BotW busy loop 2 at 0x%08x", hleAddr);
#endif
sint32 functionIndex = hleIndex_h000000002;
@@ -384,7 +384,7 @@ static void PPCInterpreter_MULHW_(PPCInterpreter_t* hCPU, uint32 opcode)
hCPU->gpr[rD] = ((uint64)c) >> 32;
if (opcode & PPC_OPC_RC) {
// update cr0 flags
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
#endif
ppc_update_cr0(hCPU, hCPU->gpr[rD]);
@@ -139,7 +139,7 @@ public:
return vAddr;
}
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (hCPU->memoryException)
assert_dbg(); // should not be set anymore
#endif
@@ -456,7 +456,7 @@ public:
{
case 0:
debug_printf("ZERO[NOP] | 0x%08X\n", (unsigned int)hCPU->instructionPointer);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
while (true) std::this_thread::sleep_for(std::chrono::seconds(1));
#endif
@@ -712,7 +712,7 @@ public:
PPCInterpreter_CMP(hCPU, opcode);
break;
case 4:
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
debug_printf("TW instruction executed at %08x\n", hCPU->instructionPointer);
#endif
PPCInterpreter_TW(hCPU, opcode);
@@ -998,7 +998,7 @@ public:
break;
default:
debug_printf("Unknown execute %04X as [31] at %08X\n", PPC_getBits(opcode, 30, 10), hCPU->instructionPointer);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
#endif
hCPU->instructionPointer += 4;
@@ -559,7 +559,7 @@ static void PPCSprSupervisor_set(PPCInterpreter_t* hCPU, uint32 spr, uint32 newV
break;
default:
debug_printf("[C%d] Set unhandled SPR 0x%x to %08x (supervisor mode)\n", hCPU->spr.UPIR, spr, newValue);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
#endif
break;
@@ -598,7 +598,7 @@ static void PPCSpr_set(PPCInterpreter_t* hCPU, uint32 spr, uint32 newValue)
break;
default:
debug_printf("[C%d] Set unhandled SPR %d to %08x\n", hCPU->spr.UPIR, spr, newValue);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
#endif
break;
@@ -782,7 +782,7 @@ static uint32 PPCSprSupervisor_get(PPCInterpreter_t* hCPU, uint32 spr)
break;
default:
debug_printf("[C%d] Get unhandled SPR %d\n", hCPU->spr.UPIR, spr);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
#endif
break;
@@ -840,7 +840,7 @@ static uint32 PPCSpr_get(PPCInterpreter_t* hCPU, uint32 spr)
break;
default:
debug_printf("[C%d] Get unhandled SPR %d\n", hCPU->spr.UPIR, spr);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
#endif
break;
@@ -153,7 +153,7 @@ private:
void checkForCollisions()
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
uint32 endOfPrevious = 0;
for (auto itr : map_ranges)
{
@@ -78,7 +78,7 @@ void PPCRecompiler_enter(PPCInterpreter_t* hCPU, PPCREC_JUMP_ENTRY funcPtr)
PPCRecompiler_enterRecompilerCode((uint64)funcPtr, (uint64)hCPU);
_controlfp(prevState, _MCW_RC);
// debug recompiler exit - useful to find frequently executed functions which couldn't be recompiled
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (hCPU->remainingCycles > 0 && GetAsyncKeyState(VK_F4))
{
auto t = std::chrono::high_resolution_clock::now();
@@ -415,7 +415,7 @@ uint32 PPCRecompilerImlGen_loadOverwriteFPRRegister(ppcImlGenContext_t* ppcImlGe
void PPCRecompilerImlGen_TW(ppcImlGenContext_t* ppcImlGenContext, uint32 opcode)
{
//#ifndef PUBLIC_RELEASE
//#ifdef CEMU_DEBUG_ASSERT
// PPCRecompilerImlGen_generateNewInstruction_macro(ppcImlGenContext, PPCREC_IML_MACRO_DEBUGBREAK, ppcImlGenContext->ppcAddressOfCurrentInstruction, 0, 0);
//#endif
PPCRecompilerImlGen_generateNewInstruction_macro(ppcImlGenContext, PPCREC_IML_MACRO_LEAVE, ppcImlGenContext->ppcAddressOfCurrentInstruction, 0, 0);
@@ -2271,7 +2271,7 @@ bool PPCRecompilerImlGen_LSWI(ppcImlGenContext_t* ppcImlGenContext, uint32 opcod
// if nb == 4 this instruction immitates LWZ
if( rA == 0 )
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg(); // special form where gpr is ignored and only imm is used
#endif
return false;
@@ -2291,7 +2291,7 @@ bool PPCRecompilerImlGen_LSWI(ppcImlGenContext_t* ppcImlGenContext, uint32 opcod
// if nb == 2 this instruction immitates a LHZ but the result is shifted left by 16 bits
if( rA == 0 )
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg(); // special form where gpr is ignored and only imm is used
#endif
return false;
@@ -2313,7 +2313,7 @@ bool PPCRecompilerImlGen_LSWI(ppcImlGenContext_t* ppcImlGenContext, uint32 opcod
// if nb == 3 this instruction loads a 3-byte big-endian and the result is shifted left by 8 bits
if( rA == 0 )
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
assert_dbg(); // special form where gpr is ignored and only imm is used
#endif
return false;
@@ -4560,7 +4560,7 @@ bool PPCRecompiler_generateIntermediateCode(ppcImlGenContext_t& ppcImlGenContext
if( ppcImlGenContext.imlList[i].type == PPCREC_IML_TYPE_JUMPMARK )
{
ppcImlGenContext.imlList[i].op_jumpmark.flags |= PPCREC_IML_OP_FLAG_UNUSED;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (map_jumpMarks.find(ppcImlGenContext.imlList[i].op_jumpmark.address) != map_jumpMarks.end())
assert_dbg();
#endif
@@ -2151,7 +2151,7 @@ void _reorderConditionModifyInstructions(PPCRecImlSegment_t* imlSegment)
}
// move CR setter instruction
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if ((unsafeInstructionIndex + 1) <= crSetterInstructionIndex)
assert_dbg();
#endif
@@ -6,7 +6,7 @@
void PPCRecRARange_addLink_perVirtualGPR(raLivenessSubrange_t** root, raLivenessSubrange_t* subrange)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if ((*root) && (*root)->range->virtualRegister != subrange->range->virtualRegister)
assert_dbg();
#endif
@@ -35,7 +35,7 @@ void PPCRecRARange_removeLink_perVirtualGPR(raLivenessSubrange_t** root, raLiven
(*root) = subrange->link_sameVirtualRegisterGPR.next;
if (subrange->link_sameVirtualRegisterGPR.next)
subrange->link_sameVirtualRegisterGPR.next->link_sameVirtualRegisterGPR.prev = tempPrev;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
subrange->link_sameVirtualRegisterGPR.prev = (raLivenessSubrange_t*)1;
subrange->link_sameVirtualRegisterGPR.next = (raLivenessSubrange_t*)1;
#endif
@@ -50,7 +50,7 @@ void PPCRecRARange_removeLink_allSubrangesGPR(raLivenessSubrange_t** root, raLiv
(*root) = subrange->link_segmentSubrangesGPR.next;
if (subrange->link_segmentSubrangesGPR.next)
subrange->link_segmentSubrangesGPR.next->link_segmentSubrangesGPR.prev = tempPrev;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
subrange->link_segmentSubrangesGPR.prev = (raLivenessSubrange_t*)1;
subrange->link_segmentSubrangesGPR.next = (raLivenessSubrange_t*)1;
#endif
@@ -162,7 +162,7 @@ void PPCRecRA_mergeRanges(ppcImlGenContext_t* ppcImlGenContext, raLivenessRange_
void PPCRecRA_mergeSubranges(ppcImlGenContext_t* ppcImlGenContext, raLivenessSubrange_t* subrange, raLivenessSubrange_t* absorbedSubrange)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
PPCRecRA_debugValidateSubrange(subrange);
PPCRecRA_debugValidateSubrange(absorbedSubrange);
if (subrange->imlSegment != absorbedSubrange->imlSegment)
@@ -212,7 +212,7 @@ void PPCRecRA_explodeRange(ppcImlGenContext_t* ppcImlGenContext, raLivenessRange
PPCRecRA_deleteRange(ppcImlGenContext, range);
}
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
void PPCRecRA_debugValidateSubrange(raLivenessSubrange_t* subrange)
{
// validate subrange
@@ -236,7 +236,7 @@ void PPCRecRA_debugValidateSubrange(raLivenessSubrange_t* subrange) {}
raLivenessSubrange_t* PPCRecRA_splitLocalSubrange(ppcImlGenContext_t* ppcImlGenContext, raLivenessSubrange_t* subrange, sint32 splitIndex, bool trimToHole)
{
// validation
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (subrange->end.index == RA_INTER_RANGE_END || subrange->end.index == RA_INTER_RANGE_START)
assert_dbg();
if (subrange->start.index >= splitIndex)
@@ -364,7 +364,7 @@ sint32 PPCRecRARange_estimateAdditionalCostAfterRangeExplode(raLivenessRange_t*
sint32 PPCRecRARange_estimateAdditionalCostAfterSplit(raLivenessSubrange_t* subrange, sint32 splitIndex)
{
// validation
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (subrange->end.index == RA_INTER_RANGE_END)
assert_dbg();
#endif
@@ -91,7 +91,7 @@ raRegisterState_t* PPCRecRA_getRegisterState(raRegisterState_t* regState, sint32
{
if (regState[i].virtualRegister == virtualRegister)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (regState[i].physicalRegister < 0)
assert_dbg();
#endif
@@ -300,7 +300,7 @@ void _sortSegmentAllSubrangesLinkedList(PPCRecImlSegment_t* imlSegment)
subrangeList[i]->link_segmentSubrangesGPR.next = subrangeList[i + 1];
}
// validate list
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
sint32 count2 = 0;
subrangeItr = imlSegment->raInfo.linkedList_allSubranges;
sint32 currentStartIndex = RA_INTER_RANGE_START;
@@ -342,7 +342,7 @@ bool PPCRecRA_assignSegmentRegisters(ppcImlGenContext_t* ppcImlGenContext, PPCRe
raLivenessSubrange_t* liverange = liveInfo.liveRangeList[f];
if (liverange->end.index <= currentIndex && liverange->end.index != RA_INTER_RANGE_END)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (liverange->subrangeBranchTaken || liverange->subrangeBranchNotTaken)
assert_dbg(); // infinite subranges should not expire
#endif
@@ -356,7 +356,7 @@ bool PPCRecRA_assignSegmentRegisters(ppcImlGenContext_t* ppcImlGenContext, PPCRe
if (subrangeItr->range->physicalRegister >= 0)
{
// verify if register is actually available
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
for (sint32 f = 0; f < liveInfo.liveRangesCount; f++)
{
raLivenessSubrange_t* liverangeItr = liveInfo.liveRangeList[f];
@@ -778,7 +778,7 @@ void PPCRecRA_generateSegmentInstructions(ppcImlGenContext_t* ppcImlGenContext,
{
liveInfo.liveRangeList[liveInfo.liveRangesCount] = subrangeItr;
liveInfo.liveRangesCount++;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
// load GPR
if (subrangeItr->_noLoad == false)
{
@@ -105,7 +105,7 @@ void PPCRecRA_createSegmentLivenessRanges(ppcImlGenContext_t* ppcImlGenContext,
for (sint32 i = 0; i < PPC_REC_MAX_VIRTUAL_GPR; i++)
{
vGPR2Subrange[i] = imlSegment->raInfo.linkedList_perVirtualGPR[i];
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (vGPR2Subrange[i] && vGPR2Subrange[i]->link_sameVirtualRegisterGPR.next != nullptr)
assert_dbg();
#endif
@@ -129,7 +129,7 @@ void PPCRecRA_createSegmentLivenessRanges(ppcImlGenContext_t* ppcImlGenContext,
bool isWrite = (t == 3);
// add location
PPCRecRA_updateOrAddSubrangeLocation(vGPR2Subrange[virtualRegister], index, isWrite == false, isWrite);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (index < vGPR2Subrange[virtualRegister]->start.index)
assert_dbg();
if (index+1 > vGPR2Subrange[virtualRegister]->end.index)
@@ -172,7 +172,7 @@ void PPCRecRA_extendRangeToBeginningOfSegment(ppcImlGenContext_t* ppcImlGenConte
void _PPCRecRA_connectRanges(ppcImlGenContext_t* ppcImlGenContext, sint32 vGPR, PPCRecImlSegment_t** route, sint32 routeDepth)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (routeDepth < 2)
assert_dbg();
#endif
@@ -226,7 +226,7 @@ void _PPCRecRA_checkAndTryExtendRange(ppcImlGenContext_t* ppcImlGenContext, PPCR
void PPCRecRA_checkAndTryExtendRange(ppcImlGenContext_t* ppcImlGenContext, PPCRecImlSegment_t* currentSegment, sint32 vGPR)
{
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (currentSegment->raDistances.reg[vGPR].usageEnd < 0)
assert_dbg();
#endif
@@ -239,7 +239,7 @@ void PPCRecRA_checkAndTryExtendRange(ppcImlGenContext_t* ppcImlGenContext, PPCRe
else
instructionsUntilEndOfSeg = currentSegment->imlListCount - currentSegment->raDistances.reg[vGPR].usageEnd;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (instructionsUntilEndOfSeg < 0)
assert_dbg();
#endif
@@ -269,7 +269,7 @@ void PPCRecRA_mergeCloseRangesForSegmentV2(ppcImlGenContext_t* ppcImlGenContext,
// check and extend if possible
PPCRecRA_checkAndTryExtendRange(ppcImlGenContext, imlSegment, i);
}
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (imlSegment->list_prevSegments.empty() == false && imlSegment->isEnterable)
assert_dbg();
if ((imlSegment->nextSegmentBranchNotTaken != nullptr || imlSegment->nextSegmentBranchTaken != nullptr) && imlSegment->nextSegmentIsUncertain)
+1 -1
View File
@@ -505,7 +505,7 @@ LatteFetchShader* LatteFetchShader::FindByGPUState()
lookupInfo->programSize = _getFSProgramSize();
lookupInfo->lastFrameAccessed = LatteGPUState.frameCounter;
g_fetchShaderLookupCache.store(fsPhysAddr24, lookupInfo);
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
cemu_assert_debug(g_fetchShaderLookupCache.lookup(fsPhysAddr24) == lookupInfo);
#endif
}
+1 -1
View File
@@ -87,7 +87,7 @@ public:
return; // do nothing if added range is already covered
rangeBegin = (std::min)(rangeBegin, (*itr).first.rangeBegin);
// DEBUG - make sure this is the start point of the merge process (the first entry that starts below minValue)
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (itr != m_map.cbegin())
{
// check previous result
@@ -136,7 +136,7 @@ uint32 LatteCP_readU32Deprc()
}
v = *(uint32*)gxRingBufferReadPtr;
gxRingBufferReadPtr += 4;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if (v == 0xcdcdcdcd)
assert_dbg();
#endif
@@ -299,7 +299,7 @@ LatteCMDPtr LatteCP_itSetRegistersGeneric(LatteCMDPtr cmd, uint32 nWords)
uint32 registerIndex = TRegisterBase + registerOffset;
uint32 registerStartIndex = registerIndex;
uint32 registerEndIndex = registerStartIndex + nWords;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
cemu_assert_debug((registerIndex + nWords) <= LATTE_MAX_REGISTER);
#endif
uint32* outputReg = (uint32*)(LatteGPUState.contextRegister + registerIndex);
@@ -340,7 +340,7 @@ LatteCMDPtr LatteCP_itSetRegistersGeneric(LatteCMDPtr cmd, uint32 nWords, TRegRa
uint32 registerIndex = TRegisterBase + registerOffset;
uint32 registerStartIndex = registerIndex;
uint32 registerEndIndex = registerStartIndex + nWords;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
cemu_assert_debug((registerIndex + nWords) <= LATTE_MAX_REGISTER);
#endif
cbRegRange(registerStartIndex, registerEndIndex);
@@ -1069,7 +1069,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
{
uint32 itCode = (itHeader >> 8) & 0xFF;
uint32 nWords = ((itHeader >> 16) & 0x3FFF) + 1;
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
LatteCMDPtr expectedPostCmd = cmd + nWords;
#endif
switch (itCode)
@@ -1126,7 +1126,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
return;
cemu_assert_debug(!drawPassCtx.isWithinDrawPass());
}
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
expectedPostCmd = cmd;
#endif
}
@@ -1156,7 +1156,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
cmd = LatteCP_itDrawIndex2(cmd, nWords, drawPassCtx);
cmd = LatteCP_processCommandBuffer_continuousDrawPass(cmd, cmdStart, cmdEnd, drawPassCtx);
cemu_assert_debug(cmd == cmdEnd || drawPassCtx.isWithinDrawPass() == false); // draw sequence should have ended if we didn't reach the end of the command buffer
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
expectedPostCmd = cmd;
#endif
}
@@ -1167,7 +1167,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
cmd = LatteCP_itDrawIndexAuto(cmd, nWords, drawPassCtx);
cmd = LatteCP_processCommandBuffer_continuousDrawPass(cmd, cmdStart, cmdEnd, drawPassCtx);
cemu_assert_debug(cmd == cmdEnd || drawPassCtx.isWithinDrawPass() == false); // draw sequence should have ended if we didn't reach the end of the command buffer
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
expectedPostCmd = cmd;
#endif
#ifdef FAST_DRAW_LOGGING
@@ -1313,7 +1313,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
cemu_assert_debug(false);
LatteSkipCMD(nWords);
}
#ifndef PUBLIC_RELEASE
#ifdef CEMU_DEBUG_ASSERT
if(cmd != expectedPostCmd)
debug_printf("cmd %016p expectedPostCmd %016p\n", cmd, expectedPostCmd);
cemu_assert_debug(cmd == expectedPostCmd);

Some files were not shown because too many files have changed in this diff Show More