summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 408375230..ea58e9f54 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -139,6 +139,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
139 immediate_input.attr[immediate_attribute_id++] = attribute; 139 immediate_input.attr[immediate_attribute_id++] = attribute;
140 140
141 if (immediate_attribute_id >= regs.vs.num_input_attributes + 1) { 141 if (immediate_attribute_id >= regs.vs.num_input_attributes + 1) {
142 MICROPROFILE_SCOPE(GPU_Drawing);
142 immediate_attribute_id = 0; 143 immediate_attribute_id = 0;
143 144
144 Shader::UnitState shader_unit; 145 Shader::UnitState shader_unit;
@@ -168,6 +169,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
168 169
169 case PICA_REG_INDEX(gpu_mode): 170 case PICA_REG_INDEX(gpu_mode):
170 if (regs.gpu_mode == Regs::GPUMode::Configuring) { 171 if (regs.gpu_mode == Regs::GPUMode::Configuring) {
172 MICROPROFILE_SCOPE(GPU_Drawing);
173
171 // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring 174 // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring
172 VideoCore::g_renderer->Rasterizer()->DrawTriangles(); 175 VideoCore::g_renderer->Rasterizer()->DrawTriangles();
173 176
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 6add9d16d..5a306a5c8 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;