mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Merge pull request #2319 from yuriks/profile-scopes
VideoCore: Make profiling scope more representative
This commit is contained in:
		
						commit
						29564d73bd
					
				
					 2 changed files with 15 additions and 0 deletions
				
			
		|  | @ -139,6 +139,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | ||||||
|                 immediate_input.attr[immediate_attribute_id++] = attribute; |                 immediate_input.attr[immediate_attribute_id++] = attribute; | ||||||
| 
 | 
 | ||||||
|                 if (immediate_attribute_id >= regs.vs.num_input_attributes + 1) { |                 if (immediate_attribute_id >= regs.vs.num_input_attributes + 1) { | ||||||
|  |                     MICROPROFILE_SCOPE(GPU_Drawing); | ||||||
|                     immediate_attribute_id = 0; |                     immediate_attribute_id = 0; | ||||||
| 
 | 
 | ||||||
|                     Shader::UnitState shader_unit; |                     Shader::UnitState shader_unit; | ||||||
|  | @ -168,6 +169,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | ||||||
| 
 | 
 | ||||||
|     case PICA_REG_INDEX(gpu_mode): |     case PICA_REG_INDEX(gpu_mode): | ||||||
|         if (regs.gpu_mode == Regs::GPUMode::Configuring) { |         if (regs.gpu_mode == Regs::GPUMode::Configuring) { | ||||||
|  |             MICROPROFILE_SCOPE(GPU_Drawing); | ||||||
|  | 
 | ||||||
|             // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring
 |             // Draw immediate mode triangles when GPU Mode is set to GPUMode::Configuring
 | ||||||
|             VideoCore::g_renderer->Rasterizer()->DrawTriangles(); |             VideoCore::g_renderer->Rasterizer()->DrawTriangles(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -11,6 +11,7 @@ | ||||||
| #include "common/color.h" | #include "common/color.h" | ||||||
| #include "common/logging/log.h" | #include "common/logging/log.h" | ||||||
| #include "common/math_util.h" | #include "common/math_util.h" | ||||||
|  | #include "common/microprofile.h" | ||||||
| #include "common/vector_math.h" | #include "common/vector_math.h" | ||||||
| #include "core/hw/gpu.h" | #include "core/hw/gpu.h" | ||||||
| #include "video_core/pica.h" | #include "video_core/pica.h" | ||||||
|  | @ -21,6 +22,10 @@ | ||||||
| #include "video_core/renderer_opengl/pica_to_gl.h" | #include "video_core/renderer_opengl/pica_to_gl.h" | ||||||
| #include "video_core/renderer_opengl/renderer_opengl.h" | #include "video_core/renderer_opengl/renderer_opengl.h" | ||||||
| 
 | 
 | ||||||
|  | MICROPROFILE_DEFINE(OpenGL_Drawing, "OpenGL", "Drawing", MP_RGB(128, 128, 192)); | ||||||
|  | MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255)); | ||||||
|  | MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100)); | ||||||
|  | 
 | ||||||
| static bool IsPassThroughTevStage(const Pica::Regs::TevStageConfig& stage) { | static bool IsPassThroughTevStage(const Pica::Regs::TevStageConfig& stage) { | ||||||
|     return (stage.color_op == Pica::Regs::TevStageConfig::Operation::Replace && |     return (stage.color_op == Pica::Regs::TevStageConfig::Operation::Replace && | ||||||
|             stage.alpha_op == Pica::Regs::TevStageConfig::Operation::Replace && |             stage.alpha_op == Pica::Regs::TevStageConfig::Operation::Replace && | ||||||
|  | @ -168,6 +173,7 @@ void RasterizerOpenGL::DrawTriangles() { | ||||||
|     if (vertex_batch.empty()) |     if (vertex_batch.empty()) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|  |     MICROPROFILE_SCOPE(OpenGL_Drawing); | ||||||
|     const auto& regs = Pica::g_state.regs; |     const auto& regs = Pica::g_state.regs; | ||||||
| 
 | 
 | ||||||
|     // Sync and bind the framebuffer surfaces
 |     // Sync and bind the framebuffer surfaces
 | ||||||
|  | @ -694,18 +700,22 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void RasterizerOpenGL::FlushAll() { | void RasterizerOpenGL::FlushAll() { | ||||||
|  |     MICROPROFILE_SCOPE(OpenGL_CacheManagement); | ||||||
|     res_cache.FlushAll(); |     res_cache.FlushAll(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void RasterizerOpenGL::FlushRegion(PAddr addr, u32 size) { | void RasterizerOpenGL::FlushRegion(PAddr addr, u32 size) { | ||||||
|  |     MICROPROFILE_SCOPE(OpenGL_CacheManagement); | ||||||
|     res_cache.FlushRegion(addr, size, nullptr, false); |     res_cache.FlushRegion(addr, size, nullptr, false); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void RasterizerOpenGL::FlushAndInvalidateRegion(PAddr addr, u32 size) { | void RasterizerOpenGL::FlushAndInvalidateRegion(PAddr addr, u32 size) { | ||||||
|  |     MICROPROFILE_SCOPE(OpenGL_CacheManagement); | ||||||
|     res_cache.FlushRegion(addr, size, nullptr, true); |     res_cache.FlushRegion(addr, size, nullptr, true); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) { | bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) { | ||||||
|  |     MICROPROFILE_SCOPE(OpenGL_Blits); | ||||||
|     using PixelFormat = CachedSurface::PixelFormat; |     using PixelFormat = CachedSurface::PixelFormat; | ||||||
|     using SurfaceType = CachedSurface::SurfaceType; |     using SurfaceType = CachedSurface::SurfaceType; | ||||||
| 
 | 
 | ||||||
|  | @ -778,6 +788,7 @@ bool RasterizerOpenGL::AccelerateTextureCopy(const GPU::Regs::DisplayTransferCon | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool RasterizerOpenGL::AccelerateFill(const GPU::Regs::MemoryFillConfig& config) { | bool RasterizerOpenGL::AccelerateFill(const GPU::Regs::MemoryFillConfig& config) { | ||||||
|  |     MICROPROFILE_SCOPE(OpenGL_Blits); | ||||||
|     using PixelFormat = CachedSurface::PixelFormat; |     using PixelFormat = CachedSurface::PixelFormat; | ||||||
|     using SurfaceType = CachedSurface::SurfaceType; |     using SurfaceType = CachedSurface::SurfaceType; | ||||||
| 
 | 
 | ||||||
|  | @ -926,6 +937,7 @@ bool RasterizerOpenGL::AccelerateDisplay(const GPU::Regs::FramebufferConfig& con | ||||||
|     if (framebuffer_addr == 0) { |     if (framebuffer_addr == 0) { | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  |     MICROPROFILE_SCOPE(OpenGL_CacheManagement); | ||||||
| 
 | 
 | ||||||
|     CachedSurface src_params; |     CachedSurface src_params; | ||||||
|     src_params.addr = framebuffer_addr; |     src_params.addr = framebuffer_addr; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue