summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-12-14 22:52:09 -0800
committerGravatar Yuri Kunde Schlesner2016-12-14 22:52:09 -0800
commitac9f9374770d7477eecab7be9110cc4a2fc357aa (patch)
tree3cbfddcbde9b24b321412f7a294a42b7a89d82fa /src
parentMerge pull request #2317 from yuriks/vertex-copy (diff)
downloadyuzu-ac9f9374770d7477eecab7be9110cc4a2fc357aa.tar.gz
yuzu-ac9f9374770d7477eecab7be9110cc4a2fc357aa.tar.xz
yuzu-ac9f9374770d7477eecab7be9110cc4a2fc357aa.zip
VideoCore: Make profiling scope more representative
Diffstat (limited to 'src')
-rw-r--r--src/video_core/command_processor.cpp3
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp12
2 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 8a5d8533c..db4fe659c 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -136,6 +136,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
136 immediate_input.attr[immediate_attribute_id++] = attribute; 136 immediate_input.attr[immediate_attribute_id++] = attribute;
137 137
138 if (immediate_attribute_id >= regs.vs.num_input_attributes + 1) { 138 if (immediate_attribute_id >= regs.vs.num_input_attributes + 1) {
139 MICROPROFILE_SCOPE(GPU_Drawing);
139 immediate_attribute_id = 0; 140 immediate_attribute_id = 0;
140 141
141 Shader::UnitState<false> shader_unit; 142 Shader::UnitState<false> shader_unit;
@@ -165,6 +166,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
165 166
166 case PICA_REG_INDEX(gpu_mode): 167 case PICA_REG_INDEX(gpu_mode):
167 if (regs.gpu_mode == Regs::GPUMode::Configuring) { 168 if (regs.gpu_mode == Regs::GPUMode::Configuring) {
169 MICROPROFILE_SCOPE(GPU_Drawing);
170
168 // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring 171 // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring
169 VideoCore::g_renderer->Rasterizer()->DrawTriangles(); 172 VideoCore::g_renderer->Rasterizer()->DrawTriangles();
170 173
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index cc7e782a4..22b8a0db2 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -11,6 +11,7 @@
11#include "common/color.h" 11#include "common/color.h"
12#include "common/logging/log.h" 12#include "common/logging/log.h"
13#include "common/math_util.h" 13#include "common/math_util.h"
14#include "common/microprofile.h"
14#include "common/vector_math.h" 15#include "common/vector_math.h"
15#include "core/hw/gpu.h" 16#include "core/hw/gpu.h"
16#include "video_core/pica.h" 17#include "video_core/pica.h"
@@ -21,6 +22,10 @@
21#include "video_core/renderer_opengl/pica_to_gl.h" 22#include "video_core/renderer_opengl/pica_to_gl.h"
22#include "video_core/renderer_opengl/renderer_opengl.h" 23#include "video_core/renderer_opengl/renderer_opengl.h"
23 24
25MICROPROFILE_DEFINE(OpenGL_Drawing, "OpenGL", "Drawing", MP_RGB(128, 128, 192));
26MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255));
27MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100));
28
24static bool IsPassThroughTevStage(const Pica::Regs::TevStageConfig& stage) { 29static bool IsPassThroughTevStage(const Pica::Regs::TevStageConfig& stage) {
25 return (stage.color_op == Pica::Regs::TevStageConfig::Operation::Replace && 30 return (stage.color_op == Pica::Regs::TevStageConfig::Operation::Replace &&
26 stage.alpha_op == Pica::Regs::TevStageConfig::Operation::Replace && 31 stage.alpha_op == Pica::Regs::TevStageConfig::Operation::Replace &&
@@ -168,6 +173,7 @@ void RasterizerOpenGL::DrawTriangles() {
168 if (vertex_batch.empty()) 173 if (vertex_batch.empty())
169 return; 174 return;
170 175
176 MICROPROFILE_SCOPE(OpenGL_Drawing);
171 const auto& regs = Pica::g_state.regs; 177 const auto& regs = Pica::g_state.regs;
172 178
173 // Sync and bind the framebuffer surfaces 179 // Sync and bind the framebuffer surfaces
@@ -694,18 +700,22 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) {
694} 700}
695 701
696void RasterizerOpenGL::FlushAll() { 702void RasterizerOpenGL::FlushAll() {
703 MICROPROFILE_SCOPE(OpenGL_CacheManagement);
697 res_cache.FlushAll(); 704 res_cache.FlushAll();
698} 705}
699 706
700void RasterizerOpenGL::FlushRegion(PAddr addr, u32 size) { 707void RasterizerOpenGL::FlushRegion(PAddr addr, u32 size) {
708 MICROPROFILE_SCOPE(OpenGL_CacheManagement);
701 res_cache.FlushRegion(addr, size, nullptr, false); 709 res_cache.FlushRegion(addr, size, nullptr, false);
702} 710}
703 711
704void RasterizerOpenGL::FlushAndInvalidateRegion(PAddr addr, u32 size) { 712void RasterizerOpenGL::FlushAndInvalidateRegion(PAddr addr, u32 size) {
713 MICROPROFILE_SCOPE(OpenGL_CacheManagement);
705 res_cache.FlushRegion(addr, size, nullptr, true); 714 res_cache.FlushRegion(addr, size, nullptr, true);
706} 715}
707 716
708bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) { 717bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) {
718 MICROPROFILE_SCOPE(OpenGL_Blits);
709 using PixelFormat = CachedSurface::PixelFormat; 719 using PixelFormat = CachedSurface::PixelFormat;
710 using SurfaceType = CachedSurface::SurfaceType; 720 using SurfaceType = CachedSurface::SurfaceType;
711 721
@@ -778,6 +788,7 @@ bool RasterizerOpenGL::AccelerateTextureCopy(const GPU::Regs::DisplayTransferCon
778} 788}
779 789
780bool RasterizerOpenGL::AccelerateFill(const GPU::Regs::MemoryFillConfig& config) { 790bool RasterizerOpenGL::AccelerateFill(const GPU::Regs::MemoryFillConfig& config) {
791 MICROPROFILE_SCOPE(OpenGL_Blits);
781 using PixelFormat = CachedSurface::PixelFormat; 792 using PixelFormat = CachedSurface::PixelFormat;
782 using SurfaceType = CachedSurface::SurfaceType; 793 using SurfaceType = CachedSurface::SurfaceType;
783 794
@@ -926,6 +937,7 @@ bool RasterizerOpenGL::AccelerateDisplay(const GPU::Regs::FramebufferConfig& con
926 if (framebuffer_addr == 0) { 937 if (framebuffer_addr == 0) {
927 return false; 938 return false;
928 } 939 }
940 MICROPROFILE_SCOPE(OpenGL_CacheManagement);
929 941
930 CachedSurface src_params; 942 CachedSurface src_params;
931 src_params.addr = framebuffer_addr; 943 src_params.addr = framebuffer_addr;