mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 21:39:01 -04:00
Add Tracy stuff
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user