Add Tracy stuff

This commit is contained in:
PJB3005
2026-04-08 03:13:37 +02:00
parent 744e29f401
commit a2d008ab09
26 changed files with 190 additions and 47 deletions
+1
View File
@@ -4041,6 +4041,7 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) {
}
void dKyr_drawStar(Mtx drawMtx, u8** tex) {
ZoneScoped;
dScnKy_env_light_c* envlight = dKy_getEnvlight();
dKankyo_star_Packet* star_packet = g_env_light.mpStarPacket;
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
+15 -11
View File
@@ -8,22 +8,23 @@
// weak data from it (unlike here).
#include "d/d_particle.h"
#include "d/d_jnt_col.h"
#include <cstdio>
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
#include "JSystem/JMath/JMATrigonometric.h"
#include "JSystem/JParticle/JPAEmitterManager.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "JSystem/JMath/JMATrigonometric.h"
#include "d/d_s_play.h"
#include <cstdio>
#include "d/d_com_inf_game.h"
#include "m_Do/m_Do_lib.h"
#include "m_Do/m_Do_graphic.h"
#include "f_op/f_op_actor_mng.h"
#include "d/actor/d_a_player.h"
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_jnt_col.h"
#include "d/d_s_play.h"
#include "f_op/f_op_actor_mng.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_lib.h"
#include "tracy/Tracy.hpp"
#ifndef __MWERKS__
#include "dusk/math.h"
@@ -1325,6 +1326,7 @@ void dPa_control_c::cleanup() {
}
void dPa_control_c::calc3D() {
ZoneScoped;
if (isStatus(2)) {
offStatus(2);
} else {
@@ -1336,12 +1338,14 @@ void dPa_control_c::calc3D() {
}
void dPa_control_c::calc2D() {
ZoneScoped;
for (u8 i = 14; i <= 16; i++) {
mEmitterMng->calc(i);
}
}
void dPa_control_c::calcMenu() {
ZoneScoped;
if (mEmitterMng != NULL) {
for (u8 i = 17; i <= 18; i++) {
mEmitterMng->calc(i);
+5
View File
@@ -17,6 +17,7 @@
#include <memory>
#include "JSystem/JKernel/JKRHeap.h"
#include "common/TracySystem.hpp"
#include "dusk/main.h"
#include "dusk/os.h"
@@ -667,6 +668,9 @@ void OSSetCurrentThreadName(const char* name) {
// "Why is this current thread only?", you might ask?
// Because macOS requires that. For some reason.
#if TRACY_ENABLE
tracy::SetThreadName(name);
#else
#if _WIN32
wchar_t buffer[256];
const auto converted = MultiByteToWideChar(
@@ -687,6 +691,7 @@ void OSSetCurrentThreadName(const char* name) {
#elif __APPLE__
pthread_setname_np(name);
#endif
#endif
}
#ifdef __cplusplus
+9
View File
@@ -14,6 +14,7 @@
#include "DuskDsp.hpp"
#include "JSystem/JAudio2/JASAudioThread.h"
#include "JSystem/JAudio2/JASDriverIF.h"
#include "tracy/Tracy.hpp"
using namespace dusk::audio;
@@ -82,18 +83,25 @@ void dusk::audio::SetEnableReverb(const bool value) {
EnableReverb = value;
}
#ifdef TRACY_ENABLE
static auto FrameName = "GetNewAudio";
#endif
void SDLCALL GetNewAudio(
void*,
SDL_AudioStream*,
int needed,
int) {
FrameMarkStart(FrameName);
while (needed > 0) {
const int rendered = RenderNewAudioFrame();
needed -= rendered;
}
FrameMarkEnd(FrameName);
}
int RenderNewAudioFrame() {
ZoneScoped;
JASCriticalSection section;
const u32 countSubframes = JASDriver::getSubFrames();
@@ -120,6 +128,7 @@ static void InterleaveOutputData(const OutputSubframe& data, std::span<f32> targ
}
void RenderAudioSubframe() {
ZoneScoped;
OutBuffer = {};
JASDriver::updateDSP();
+2
View File
@@ -14,6 +14,7 @@
#include "dusk/audio/DuskAudioSystem.h"
#include "dusk/endian.h"
#include "global.h"
#include "tracy/Tracy.hpp"
using namespace dusk::audio;
@@ -133,6 +134,7 @@ static void MixSubframe(DspSubframe& dst, const DspSubframe& src) {
}
void dusk::audio::DspRender(OutputSubframe& subframe) {
ZoneScoped;
if (DumpAudio != sDumpWasActive) {
sDumpWasActive = DumpAudio;
if (DumpAudio) {
+3 -1
View File
@@ -2,7 +2,9 @@
#include <mutex>
static std::recursive_mutex gAudioThreadMutex;
#include "tracy/Tracy.hpp"
static TracyLockable(std::recursive_mutex, gAudioThreadMutex);
JASCriticalSection::JASCriticalSection() {
gAudioThreadMutex.lock();
+2
View File
@@ -17,6 +17,7 @@
#include "dusk/settings.h"
#include "dusk/audio/DuskAudioSystem.h"
#include "dusk/dusk.h"
#include "tracy/Tracy.hpp"
#if _WIN32
#define NOMINMAX
@@ -200,6 +201,7 @@ namespace dusk {
}
void ImGuiConsole::PreDraw() {
ZoneScoped;
if (!m_isLaunchInitialized) {
InitSettings();
+3
View File
@@ -2,6 +2,8 @@
#include <cstdio>
#include <cstdlib>
#include "tracy/Tracy.hpp"
bool StubLogEnabled = true;
using namespace std::literals::string_view_literals;
@@ -32,6 +34,7 @@ static bool IsForStubLog(const char* message) {
void aurora_log_callback(AuroraLogLevel level, const char* module, const char* message,
unsigned int len) {
ZoneScoped;
if (StubLogEnabled && level != LOG_FATAL && IsForStubLog(message)) {
dusk::SendToStubLog(level, module, message);
return;
+3
View File
@@ -13,6 +13,8 @@
#include <dusk/logging.h>
#include <dusk/main.h>
#include "tracy/Tracy.hpp"
#ifndef _WIN32
#include <sys/time.h>
#include <time.h>
@@ -355,6 +357,7 @@ void VISetNextFrameBuffer(void* fb) {
}
void VIWaitForRetrace() {
ZoneScoped;
sRetraceCount++;
if (sVIPreRetraceCallback) {
sVIPreRetraceCallback(sRetraceCount);
+18 -16
View File
@@ -1,26 +1,27 @@
#include "f_ap/f_ap_game.h"
#include <cstring>
#include "DynamicLink.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/J3DGraphLoader/J3DModelSaver.h"
#include "JSystem/JHostIO/JORFile.h"
#include "JSystem/JKernel/JKRAram.h"
#include "JSystem/JKernel/JKRAramArchive.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "SSystem/SComponent/c_counter.h"
#include "d/actor/d_a_alink.h"
#include "d/actor/d_a_grass.h"
#include "d/actor/d_a_midna.h"
#include "d/d_model.h"
#include "d/d_tresure.h"
#include "dusk/logging.h"
#include "f_op/f_op_camera_mng.h"
#include "f_op/f_op_draw_tag.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_scene_mng.h"
#include "m_Do/m_Do_main.h"
#include "m_Do/m_Do_graphic.h"
#include "DynamicLink.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/JKernel/JKRAram.h"
#include "JSystem/JKernel/JKRAramArchive.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "JSystem/JHostIO/JORFile.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/J3DGraphLoader/J3DModelSaver.h"
#include "d/actor/d_a_alink.h"
#include "d/actor/d_a_midna.h"
#include "d/d_model.h"
#include "d/actor/d_a_grass.h"
#include "d/d_tresure.h"
#include <cstring>
#include "dusk/logging.h"
#include "m_Do/m_Do_main.h"
#include "tracy/Tracy.hpp"
fapGm_HIO_c::fapGm_HIO_c() {
mUsingHostIO = true;
@@ -722,6 +723,7 @@ void fapGm_After() {
}
void fapGm_Execute() {
ZoneScoped;
static u32 sExecCount = 0;
if (sExecCount < 10 || (sExecCount % 300 == 0)) {
DuskLog.debug("fapGm_Execute frame={}", sExecCount);
+3
View File
@@ -22,6 +22,8 @@
#include "m_Do/m_Do_controller_pad.h"
#include <cstdio>
#include "tracy/Tracy.hpp"
void fpcM_Draw(void* i_proc) {
fpcDw_Execute((base_process_class*)i_proc);
}
@@ -43,6 +45,7 @@ BOOL fpcM_IsCreating(fpc_ProcID i_id) {
}
void fpcM_Management(fpcM_ManagementFunc i_preExecuteFn, fpcM_ManagementFunc i_postExecuteFn) {
ZoneScoped;
MtxInit();
if (!fapGm_HIO_c::isCaptureScreen()) {
dComIfGd_peekZdata();
+2
View File
@@ -12,6 +12,7 @@
#include "d/d_debug_viewer.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_dvd_thread.h"
#include "tracy/Tracy.hpp"
#if PLATFORM_WII || PLATFORM_SHIELD
#include "Z2AudioCS/Z2AudioCS.h"
@@ -157,6 +158,7 @@ static void mDoAud_Create() {
void mDoAud_Execute() {
DUSK_AUDIO_SKIP()
ZoneScoped;
if (!mDoAud_zelAudio_c::isInitFlag()) {
if (!mDoRst::isShutdown() && !mDoRst::isReturnToMenu()) {
+2
View File
@@ -10,6 +10,7 @@
#include "f_ap/f_ap_game.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_main.h"
#include "tracy/Tracy.hpp"
JUTGamePad* mDoCPd_c::m_gamePad[4];
@@ -56,6 +57,7 @@ void mDoCPd_c::create() {
}
void mDoCPd_c::read() {
ZoneScoped;
JUTGamePad::read();
if (!mDoRst::isReset() && mDoRst::is3ButtonReset()) {
+20 -10
View File
@@ -7,6 +7,9 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include <base/PPCArch.h>
#include <cstring>
#include "DynamicLink.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/J2DGraph/J2DPrint.h"
#include "JSystem/JAWExtSystem/JAWExtSystem.h"
@@ -19,24 +22,22 @@
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_menu_collect.h"
#include "d/d_debug_viewer.h"
#include "d/d_jcam_editor.h"
#include "d/d_jpreviewer.h"
#include <base/PPCArch.h>
#include "d/d_menu_collect.h"
#include "d/d_meter2_info.h"
#include "d/d_s_play.h"
#include "dusk/endian.h"
#include "dusk/gx_helper.h"
#include "dusk/logging.h"
#include "f_ap/f_ap_game.h"
#include "f_op/f_op_camera_mng.h"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_machine.h"
#include "m_Do/m_Do_main.h"
#include "d/d_debug_viewer.h"
#include "d/d_meter2_info.h"
#include "d/d_s_play.h"
#include "DynamicLink.h"
#include <cstring>
#include "dusk/endian.h"
#include "dusk/logging.h"
#include "dusk/gx_helper.h"
#include "tracy/Tracy.hpp"
#if PLATFORM_WII || PLATFORM_SHIELD
#include <revolution/sc.h>
@@ -348,6 +349,8 @@ void mDoGph_gInf_c::create() {
static bool data_80450BE8;
void mDoGph_gInf_c::beginRender() {
ZoneScoped;
#if PLATFORM_WII || PLATFORM_SHIELD
VISetTrapFilter(fapGmHIO_getTrapFilter() ? 1 : 0);
VISetGamma((VIGamma)fapGmHIO_getGamma());
@@ -416,6 +419,7 @@ void mDoGph_gInf_c::fadeOut(f32 fadeSpeed) {
}
void darwFilter(GXColor matColor) {
ZoneScoped;
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE,
GX_AF_NONE);
@@ -834,6 +838,7 @@ void mDoGph_drawFilterQuad(s8 param_0, s8 param_1) {
#endif
static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_2) {
ZoneScoped;
static GXColorS10 l_tevColor0 = {0, 0, 0, 0};
if (daPy_getLinkPlayerActorClass() != NULL) {
@@ -1087,6 +1092,7 @@ static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_
}
static void trimming(view_class* param_0, view_port_class* param_1) {
ZoneScoped;
UNUSED(param_0);
s16 y_orig = (int)param_1->y_orig & ~7;
@@ -1199,6 +1205,7 @@ void mDoGph_gInf_c::bloom_c::remove() {
void mDoGph_gInf_c::bloom_c::draw() {
#if TARGET_PC
ZoneScoped;
if (!dusk::getSettings().game.enableBloom) {
return;
}
@@ -1473,6 +1480,7 @@ static void retry_captue_frame(view_class* param_0, view_port_class* param_1, in
}
static void motionBlure(view_class* param_0) {
ZoneScoped;
if (g_env_light.is_blure) {
GXLoadTexObj(mDoGph_gInf_c::getFrameBufferTexObj(), GX_TEXMAP0);
GXColor local_60;
@@ -1652,6 +1660,7 @@ static void captureScreenPerspDrawInfo(JPADrawInfo& info) {
#endif
static void drawItem3D() {
ZoneScoped;
Mtx item_mtx;
dMenu_Collect3D_c::setupItem3D(item_mtx);
@@ -1668,6 +1677,7 @@ static void drawItem3D() {
}
int mDoGph_Painter() {
ZoneScoped;
// Diagnostic: log windowNum to track game state machine progress
static bool sDiagLoggedWindow = false;
if (!sDiagLoggedWindow) {
+3
View File
@@ -60,6 +60,7 @@
#include "SDL3/SDL_filesystem.h"
#include "cxxopts.hpp"
#include "dusk/config.hpp"
#include "tracy/Tracy.hpp"
// --- GLOBALS ---
s8 mDoMain::developmentMode = -1;
@@ -198,6 +199,8 @@ void main01(void) {
mDoAud_Execute();
aurora_end_frame();
FrameMark;
} while (true);
exit:;