mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-27 08:53:23 -04:00
Fix Aurora draw call display in performance overlay
It was getting reset at the start of the frame... Just cache the values.
This commit is contained in:
@@ -3,7 +3,13 @@
|
||||
|
||||
#include <aurora/aurora.h>
|
||||
|
||||
#include "aurora/gfx.h"
|
||||
|
||||
extern AuroraInfo auroraInfo;
|
||||
extern const char* configPath;
|
||||
|
||||
namespace dusk {
|
||||
extern AuroraStats lastFrameAuroraStats;
|
||||
}
|
||||
|
||||
#endif // DUSK_DUSK_H
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "d/actor/d_a_alink.h"
|
||||
#include "d/actor/d_a_horse.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "dusk/dusk.h"
|
||||
#include "m_Do/m_Do_main.h"
|
||||
|
||||
namespace dusk {
|
||||
@@ -109,31 +110,31 @@ namespace dusk {
|
||||
}
|
||||
hasPrevious = true;
|
||||
|
||||
AuroraStats const* stats = aurora_get_stats();
|
||||
const auto& stats = lastFrameAuroraStats;
|
||||
|
||||
ImGuiStringViewText(
|
||||
fmt::format(FMT_STRING("Queued pipelines: {}\n"), stats->queuedPipelines));
|
||||
fmt::format(FMT_STRING("Queued pipelines: {}\n"), stats.queuedPipelines));
|
||||
ImGuiStringViewText(
|
||||
fmt::format(FMT_STRING("Done pipelines: {}\n"), stats->createdPipelines));
|
||||
fmt::format(FMT_STRING("Done pipelines: {}\n"), stats.createdPipelines));
|
||||
ImGuiStringViewText(
|
||||
fmt::format(FMT_STRING("Draw call count: {}\n"), stats->drawCallCount));
|
||||
fmt::format(FMT_STRING("Draw call count: {}\n"), stats.drawCallCount));
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("Merged draw calls: {}\n"),
|
||||
stats->mergedDrawCallCount));
|
||||
stats.mergedDrawCallCount));
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("Vertex size: {}\n"),
|
||||
BytesToString(stats->lastVertSize)));
|
||||
BytesToString(stats.lastVertSize)));
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("Uniform size: {}\n"),
|
||||
BytesToString(stats->lastUniformSize)));
|
||||
BytesToString(stats.lastUniformSize)));
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("Index size: {}\n"),
|
||||
BytesToString(stats->lastIndexSize)));
|
||||
BytesToString(stats.lastIndexSize)));
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("Storage size: {}\n"),
|
||||
BytesToString(stats->lastStorageSize)));
|
||||
BytesToString(stats.lastStorageSize)));
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("Tex upload size: {}\n"),
|
||||
BytesToString(stats->lastTextureUploadSize)));
|
||||
BytesToString(stats.lastTextureUploadSize)));
|
||||
ImGuiStringViewText(fmt::format(
|
||||
FMT_STRING("Total: {}\n"),
|
||||
BytesToString(stats->lastVertSize + stats->lastUniformSize +
|
||||
stats->lastIndexSize + stats->lastStorageSize +
|
||||
stats->lastTextureUploadSize)));
|
||||
BytesToString(stats.lastVertSize + stats.lastUniformSize +
|
||||
stats.lastIndexSize + stats.lastStorageSize +
|
||||
stats.lastTextureUploadSize)));
|
||||
|
||||
// TODO: persist to config
|
||||
ShowCornerContextMenu(m_debugOverlayCorner, m_cameraOverlayCorner);
|
||||
|
||||
@@ -110,6 +110,7 @@ s32 LOAD_COPYDATE(void*) {
|
||||
}
|
||||
|
||||
AuroraInfo auroraInfo;
|
||||
AuroraStats dusk::lastFrameAuroraStats;
|
||||
const char* configPath;
|
||||
|
||||
void main01(void) {
|
||||
@@ -182,6 +183,7 @@ void main01(void) {
|
||||
VIWaitForRetrace();
|
||||
|
||||
#if TARGET_PC
|
||||
dusk::lastFrameAuroraStats = *aurora_get_stats();
|
||||
if (!aurora_begin_frame()) {
|
||||
DuskLog.debug("aurora_begin_frame returned false, skipping draw this frame");
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user