From 80e4dbdce7e1e39c0f0594eea8d8de7c8ebdcae5 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Tue, 6 Nov 2018 10:42:33 +0100 Subject: [PATCH] gl_stream_buffer: Profile orphaning of stream buffer. This serialize to the driver thread and so it may block for a while. So if it is in the benchmark, we get noticed if it happens too often. --- src/video_core/renderer_opengl/gl_stream_buffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_stream_buffer.cpp b/src/video_core/renderer_opengl/gl_stream_buffer.cpp index e409228ccf..b97b895a44 100644 --- a/src/video_core/renderer_opengl/gl_stream_buffer.cpp +++ b/src/video_core/renderer_opengl/gl_stream_buffer.cpp @@ -6,9 +6,13 @@ #include #include "common/alignment.h" #include "common/assert.h" +#include "common/microprofile.h" #include "video_core/renderer_opengl/gl_state.h" #include "video_core/renderer_opengl/gl_stream_buffer.h" +MICROPROFILE_DEFINE(OpenGL_StreamBuffer, "OpenGL", "Stream Buffer Orphaning", + MP_RGB(128, 128, 192)); + namespace OpenGL { OGLStreamBuffer::OGLStreamBuffer(GLenum target, GLsizeiptr size, bool prefer_coherent) @@ -75,6 +79,7 @@ std::tuple OGLStreamBuffer::Map(GLsizeiptr size, GLintptr a } if (invalidate || !persistent) { + MICROPROFILE_SCOPE(OpenGL_StreamBuffer); GLbitfield flags = GL_MAP_WRITE_BIT | (persistent ? GL_MAP_PERSISTENT_BIT : 0) | (coherent ? GL_MAP_COHERENT_BIT : GL_MAP_FLUSH_EXPLICIT_BIT) | (invalidate ? GL_MAP_INVALIDATE_BUFFER_BIT : GL_MAP_UNSYNCHRONIZED_BIT);