diff options
| author | 2018-11-06 10:42:33 +0100 | |
|---|---|---|
| committer | 2018-11-06 17:45:32 +0100 | |
| commit | 80e4dbdce7e1e39c0f0594eea8d8de7c8ebdcae5 (patch) | |
| tree | 0fcc3a99360bf0bb692371b0eb809e028e30b6b5 /src | |
| parent | microprofile: Drop ReleaseActiveBuffer scope. (diff) | |
| download | yuzu-80e4dbdce7e1e39c0f0594eea8d8de7c8ebdcae5.tar.gz yuzu-80e4dbdce7e1e39c0f0594eea8d8de7c8ebdcae5.tar.xz yuzu-80e4dbdce7e1e39c0f0594eea8d8de7c8ebdcae5.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_stream_buffer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_stream_buffer.cpp b/src/video_core/renderer_opengl/gl_stream_buffer.cpp index e409228cc..b97b895a4 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 @@ | |||
| 6 | #include <vector> | 6 | #include <vector> |
| 7 | #include "common/alignment.h" | 7 | #include "common/alignment.h" |
| 8 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 9 | #include "common/microprofile.h" | ||
| 9 | #include "video_core/renderer_opengl/gl_state.h" | 10 | #include "video_core/renderer_opengl/gl_state.h" |
| 10 | #include "video_core/renderer_opengl/gl_stream_buffer.h" | 11 | #include "video_core/renderer_opengl/gl_stream_buffer.h" |
| 11 | 12 | ||
| 13 | MICROPROFILE_DEFINE(OpenGL_StreamBuffer, "OpenGL", "Stream Buffer Orphaning", | ||
| 14 | MP_RGB(128, 128, 192)); | ||
| 15 | |||
| 12 | namespace OpenGL { | 16 | namespace OpenGL { |
| 13 | 17 | ||
| 14 | OGLStreamBuffer::OGLStreamBuffer(GLenum target, GLsizeiptr size, bool prefer_coherent) | 18 | OGLStreamBuffer::OGLStreamBuffer(GLenum target, GLsizeiptr size, bool prefer_coherent) |
| @@ -75,6 +79,7 @@ std::tuple<u8*, GLintptr, bool> OGLStreamBuffer::Map(GLsizeiptr size, GLintptr a | |||
| 75 | } | 79 | } |
| 76 | 80 | ||
| 77 | if (invalidate || !persistent) { | 81 | if (invalidate || !persistent) { |
| 82 | MICROPROFILE_SCOPE(OpenGL_StreamBuffer); | ||
| 78 | GLbitfield flags = GL_MAP_WRITE_BIT | (persistent ? GL_MAP_PERSISTENT_BIT : 0) | | 83 | GLbitfield flags = GL_MAP_WRITE_BIT | (persistent ? GL_MAP_PERSISTENT_BIT : 0) | |
| 79 | (coherent ? GL_MAP_COHERENT_BIT : GL_MAP_FLUSH_EXPLICIT_BIT) | | 84 | (coherent ? GL_MAP_COHERENT_BIT : GL_MAP_FLUSH_EXPLICIT_BIT) | |
| 80 | (invalidate ? GL_MAP_INVALIDATE_BUFFER_BIT : GL_MAP_UNSYNCHRONIZED_BIT); | 85 | (invalidate ? GL_MAP_INVALIDATE_BUFFER_BIT : GL_MAP_UNSYNCHRONIZED_BIT); |