diff options
| author | 2015-08-17 18:25:21 -0300 | |
|---|---|---|
| committer | 2015-08-24 22:16:28 -0300 | |
| commit | 0fcabd2b11a5b1d4d16f6f6bdf1efd54d2c45237 (patch) | |
| tree | a1651d48113413e2de1e6e309362511b1ff7ffa8 /src/video_core/renderer_opengl | |
| parent | citra-qt: Add helper function to get a monospace QFont (diff) | |
| download | yuzu-0fcabd2b11a5b1d4d16f6f6bdf1efd54d2c45237.tar.gz yuzu-0fcabd2b11a5b1d4d16f6f6bdf1efd54d2c45237.tar.xz yuzu-0fcabd2b11a5b1d4d16f6f6bdf1efd54d2c45237.zip | |
Integrate the MicroProfile profiling library
This brings goodies such as a configurable user interface and
multi-threaded timeline view.
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 9f1552adf..deb9971bb 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include "common/color.h" | 8 | #include "common/color.h" |
| 9 | #include "common/math_util.h" | 9 | #include "common/math_util.h" |
| 10 | #include "common/microprofile.h" | ||
| 10 | #include "common/profiler.h" | 11 | #include "common/profiler.h" |
| 11 | 12 | ||
| 12 | #include "core/hw/gpu.h" | 13 | #include "core/hw/gpu.h" |
| @@ -777,12 +778,16 @@ void RasterizerOpenGL::SyncDrawState() { | |||
| 777 | state.Apply(); | 778 | state.Apply(); |
| 778 | } | 779 | } |
| 779 | 780 | ||
| 781 | MICROPROFILE_DEFINE(OpenGL_FramebufferReload, "OpenGL", "FB Reload", MP_RGB(70, 70, 200)); | ||
| 782 | |||
| 780 | void RasterizerOpenGL::ReloadColorBuffer() { | 783 | void RasterizerOpenGL::ReloadColorBuffer() { |
| 781 | u8* color_buffer = Memory::GetPhysicalPointer(Pica::g_state.regs.framebuffer.GetColorBufferPhysicalAddress()); | 784 | u8* color_buffer = Memory::GetPhysicalPointer(Pica::g_state.regs.framebuffer.GetColorBufferPhysicalAddress()); |
| 782 | 785 | ||
| 783 | if (color_buffer == nullptr) | 786 | if (color_buffer == nullptr) |
| 784 | return; | 787 | return; |
| 785 | 788 | ||
| 789 | MICROPROFILE_SCOPE(OpenGL_FramebufferReload); | ||
| 790 | |||
| 786 | u32 bytes_per_pixel = Pica::Regs::BytesPerColorPixel(fb_color_texture.format); | 791 | u32 bytes_per_pixel = Pica::Regs::BytesPerColorPixel(fb_color_texture.format); |
| 787 | 792 | ||
| 788 | std::unique_ptr<u8[]> temp_fb_color_buffer(new u8[fb_color_texture.width * fb_color_texture.height * bytes_per_pixel]); | 793 | std::unique_ptr<u8[]> temp_fb_color_buffer(new u8[fb_color_texture.width * fb_color_texture.height * bytes_per_pixel]); |
| @@ -822,6 +827,8 @@ void RasterizerOpenGL::ReloadDepthBuffer() { | |||
| 822 | if (depth_buffer == nullptr) | 827 | if (depth_buffer == nullptr) |
| 823 | return; | 828 | return; |
| 824 | 829 | ||
| 830 | MICROPROFILE_SCOPE(OpenGL_FramebufferReload); | ||
| 831 | |||
| 825 | u32 bytes_per_pixel = Pica::Regs::BytesPerDepthPixel(fb_depth_texture.format); | 832 | u32 bytes_per_pixel = Pica::Regs::BytesPerDepthPixel(fb_depth_texture.format); |
| 826 | 833 | ||
| 827 | // OpenGL needs 4 bpp alignment for D24 | 834 | // OpenGL needs 4 bpp alignment for D24 |
| @@ -868,6 +875,7 @@ void RasterizerOpenGL::ReloadDepthBuffer() { | |||
| 868 | } | 875 | } |
| 869 | 876 | ||
| 870 | Common::Profiling::TimingCategory buffer_commit_category("Framebuffer Commit"); | 877 | Common::Profiling::TimingCategory buffer_commit_category("Framebuffer Commit"); |
| 878 | MICROPROFILE_DEFINE(OpenGL_FramebufferCommit, "OpenGL", "FB Commit", MP_RGB(70, 70, 200)); | ||
| 871 | 879 | ||
| 872 | void RasterizerOpenGL::CommitColorBuffer() { | 880 | void RasterizerOpenGL::CommitColorBuffer() { |
| 873 | if (last_fb_color_addr != 0) { | 881 | if (last_fb_color_addr != 0) { |
| @@ -875,6 +883,7 @@ void RasterizerOpenGL::CommitColorBuffer() { | |||
| 875 | 883 | ||
| 876 | if (color_buffer != nullptr) { | 884 | if (color_buffer != nullptr) { |
| 877 | Common::Profiling::ScopeTimer timer(buffer_commit_category); | 885 | Common::Profiling::ScopeTimer timer(buffer_commit_category); |
| 886 | MICROPROFILE_SCOPE(OpenGL_FramebufferCommit); | ||
| 878 | 887 | ||
| 879 | u32 bytes_per_pixel = Pica::Regs::BytesPerColorPixel(fb_color_texture.format); | 888 | u32 bytes_per_pixel = Pica::Regs::BytesPerColorPixel(fb_color_texture.format); |
| 880 | 889 | ||
| @@ -911,6 +920,7 @@ void RasterizerOpenGL::CommitDepthBuffer() { | |||
| 911 | 920 | ||
| 912 | if (depth_buffer != nullptr) { | 921 | if (depth_buffer != nullptr) { |
| 913 | Common::Profiling::ScopeTimer timer(buffer_commit_category); | 922 | Common::Profiling::ScopeTimer timer(buffer_commit_category); |
| 923 | MICROPROFILE_SCOPE(OpenGL_FramebufferCommit); | ||
| 914 | 924 | ||
| 915 | u32 bytes_per_pixel = Pica::Regs::BytesPerDepthPixel(fb_depth_texture.format); | 925 | u32 bytes_per_pixel = Pica::Regs::BytesPerDepthPixel(fb_depth_texture.format); |
| 916 | 926 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 70f0ba5f1..e4247051c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/make_unique.h" | 5 | #include "common/make_unique.h" |
| 6 | #include "common/math_util.h" | 6 | #include "common/math_util.h" |
| 7 | #include "common/microprofile.h" | ||
| 7 | #include "common/vector_math.h" | 8 | #include "common/vector_math.h" |
| 8 | 9 | ||
| 9 | #include "core/memory.h" | 10 | #include "core/memory.h" |
| @@ -16,6 +17,8 @@ RasterizerCacheOpenGL::~RasterizerCacheOpenGL() { | |||
| 16 | FullFlush(); | 17 | FullFlush(); |
| 17 | } | 18 | } |
| 18 | 19 | ||
| 20 | MICROPROFILE_DEFINE(OpenGL_TextureUpload, "OpenGL", "Texture Upload", MP_RGB(128, 64, 192)); | ||
| 21 | |||
| 19 | void RasterizerCacheOpenGL::LoadAndBindTexture(OpenGLState &state, unsigned texture_unit, const Pica::Regs::FullTextureConfig& config) { | 22 | void RasterizerCacheOpenGL::LoadAndBindTexture(OpenGLState &state, unsigned texture_unit, const Pica::Regs::FullTextureConfig& config) { |
| 20 | PAddr texture_addr = config.config.GetPhysicalAddress(); | 23 | PAddr texture_addr = config.config.GetPhysicalAddress(); |
| 21 | 24 | ||
| @@ -25,6 +28,8 @@ void RasterizerCacheOpenGL::LoadAndBindTexture(OpenGLState &state, unsigned text | |||
| 25 | state.texture_units[texture_unit].texture_2d = cached_texture->second->texture.handle; | 28 | state.texture_units[texture_unit].texture_2d = cached_texture->second->texture.handle; |
| 26 | state.Apply(); | 29 | state.Apply(); |
| 27 | } else { | 30 | } else { |
| 31 | MICROPROFILE_SCOPE(OpenGL_TextureUpload); | ||
| 32 | |||
| 28 | std::unique_ptr<CachedTexture> new_texture = Common::make_unique<CachedTexture>(); | 33 | std::unique_ptr<CachedTexture> new_texture = Common::make_unique<CachedTexture>(); |
| 29 | 34 | ||
| 30 | new_texture->texture.Create(); | 35 | new_texture->texture.Create(); |