From 19672cfee806bba23b6da4581f87a9b1826f3224 Mon Sep 17 00:00:00 2001 From: Phantom Date: Fri, 29 Dec 2017 17:01:37 +0100 Subject: [PATCH] CachedSurface: Add microprofile scopes for UploadGLTexture and DownloadGLTexture --- src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 66b6022cbd..aa3009b5bc 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -723,11 +723,14 @@ void CachedSurface::FlushGLBuffer(PAddr flush_start, PAddr flush_end) { } } +MICROPROFILE_DEFINE(OpenGL_TextureUL, "OpenGL", "Texture Upload", MP_RGB(128, 64, 192)); void CachedSurface::UploadGLTexture(const MathUtil::Rectangle& rect, GLuint read_fb_handle, GLuint draw_fb_handle) { if (type == SurfaceType::Fill) return; + MICROPROFILE_SCOPE(OpenGL_TextureUL); + ASSERT(gl_buffer_size == width * height * GetGLBytesPerPixel(pixel_format)); // Load data from memory to the surface @@ -782,11 +785,14 @@ void CachedSurface::UploadGLTexture(const MathUtil::Rectangle& rect, GLuint } } +MICROPROFILE_DEFINE(OpenGL_TextureDL, "OpenGL", "Texture Download", MP_RGB(128, 192, 64)); void CachedSurface::DownloadGLTexture(const MathUtil::Rectangle& rect, GLuint read_fb_handle, GLuint draw_fb_handle) { if (type == SurfaceType::Fill) return; + MICROPROFILE_SCOPE(OpenGL_TextureDL); + if (gl_buffer == nullptr) { gl_buffer_size = width * height * GetGLBytesPerPixel(pixel_format); gl_buffer.reset(new u8[gl_buffer_size]);