From 448856695a5eebfccf46b69918cd18369c849e15 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Thu, 12 Mar 2020 10:50:48 -0400 Subject: [PATCH 1/2] Microprofile: Allow accessing token. --- externals/microprofile/microprofile.h | 1 + 1 file changed, 1 insertion(+) diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h index cdb312b87..c1556d10c 100644 --- a/externals/microprofile/microprofile.h +++ b/externals/microprofile/microprofile.h @@ -243,6 +243,7 @@ typedef uint32_t ThreadIdType; #define MICROPROFILE_DEFINE_GPU(var, name, color) MicroProfileToken g_mp_##var = MicroProfileGetToken("GPU", name, color, MicroProfileTokenTypeGpu) #define MICROPROFILE_TOKEN_PASTE0(a, b) a ## b #define MICROPROFILE_TOKEN_PASTE(a, b) MICROPROFILE_TOKEN_PASTE0(a,b) +#define MICROPROFILE_TOKEN(var) g_mp_##var #define MICROPROFILE_SCOPE(var) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(g_mp_##var) #define MICROPROFILE_SCOPE_TOKEN(token) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(token) #define MICROPROFILE_SCOPEI(group, name, color) static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp,__LINE__) = MicroProfileGetToken(group, name, color, MicroProfileTokenTypeCpu); MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo,__LINE__)( MICROPROFILE_TOKEN_PASTE(g_mp,__LINE__)) From 95b804ff0565a653109c1a7f7326eecc838fee5c Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Thu, 12 Mar 2020 10:52:44 -0400 Subject: [PATCH 2/2] NVFlinger: Do the microprofile Flip after processing a valid frame. --- src/core/hle/service/nvflinger/nvflinger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 134152210..437bc5dee 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -191,8 +191,6 @@ void NVFlinger::Compose() { // Search for a queued buffer and acquire it auto buffer = buffer_queue.AcquireBuffer(); - MicroProfileFlip(); - if (!buffer) { continue; } @@ -206,6 +204,8 @@ void NVFlinger::Compose() { gpu.WaitFence(fence.id, fence.value); } + MicroProfileFlip(); + // Now send the buffer to the GPU for drawing. // TODO(Subv): Support more than just disp0. The display device selection is probably based // on which display we're drawing (Default, Internal, External, etc)