diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.h | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 23 |
3 files changed, 22 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index e824e216d..1a2e2a9f7 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp | |||
| @@ -157,7 +157,6 @@ Device::Device() : base_bindings{BuildBaseBindings()} { | |||
| 157 | has_precise_bug = TestPreciseBug(); | 157 | has_precise_bug = TestPreciseBug(); |
| 158 | has_broken_compute = is_intel_proprietary; | 158 | has_broken_compute = is_intel_proprietary; |
| 159 | has_fast_buffer_sub_data = is_nvidia; | 159 | has_fast_buffer_sub_data = is_nvidia; |
| 160 | has_debug_tool = HasExtension(extensions, "GL_EXT_debug_tool"); | ||
| 161 | 160 | ||
| 162 | LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); | 161 | LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); |
| 163 | LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); | 162 | LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); |
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index 7aaa3a077..d73b099d0 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h | |||
| @@ -84,10 +84,6 @@ public: | |||
| 84 | return has_fast_buffer_sub_data; | 84 | return has_fast_buffer_sub_data; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | bool HasDebugTool() const { | ||
| 88 | return has_debug_tool; | ||
| 89 | } | ||
| 90 | |||
| 91 | private: | 87 | private: |
| 92 | static bool TestVariableAoffi(); | 88 | static bool TestVariableAoffi(); |
| 93 | static bool TestPreciseBug(); | 89 | static bool TestPreciseBug(); |
| @@ -106,7 +102,6 @@ private: | |||
| 106 | bool has_precise_bug{}; | 102 | bool has_precise_bug{}; |
| 107 | bool has_broken_compute{}; | 103 | bool has_broken_compute{}; |
| 108 | bool has_fast_buffer_sub_data{}; | 104 | bool has_fast_buffer_sub_data{}; |
| 109 | bool has_debug_tool{}; | ||
| 110 | }; | 105 | }; |
| 111 | 106 | ||
| 112 | } // namespace OpenGL | 107 | } // namespace OpenGL |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index c91658cd1..d8ecd090b 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -5,8 +5,11 @@ | |||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <cstddef> | 6 | #include <cstddef> |
| 7 | #include <cstdlib> | 7 | #include <cstdlib> |
| 8 | #include <cstring> | ||
| 8 | #include <memory> | 9 | #include <memory> |
| 10 | |||
| 9 | #include <glad/glad.h> | 11 | #include <glad/glad.h> |
| 12 | |||
| 10 | #include "common/assert.h" | 13 | #include "common/assert.h" |
| 11 | #include "common/logging/log.h" | 14 | #include "common/logging/log.h" |
| 12 | #include "common/microprofile.h" | 15 | #include "common/microprofile.h" |
| @@ -25,6 +28,24 @@ | |||
| 25 | 28 | ||
| 26 | namespace OpenGL { | 29 | namespace OpenGL { |
| 27 | 30 | ||
| 31 | /// Returns true if any debug tool is attached | ||
| 32 | bool HasDebugTool() { | ||
| 33 | const bool nsight = std::getenv("NVTX_INJECTION64_PATH") || std::getenv("NSIGHT_LAUNCHED"); | ||
| 34 | if (nsight) { | ||
| 35 | return true; | ||
| 36 | } | ||
| 37 | |||
| 38 | GLint num_extensions; | ||
| 39 | glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); | ||
| 40 | for (GLuint index = 0; index < static_cast<GLuint>(num_extensions); ++index) { | ||
| 41 | const auto name = reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, index)); | ||
| 42 | if (!std::strcmp(name, "GL_EXT_debug_tool")) { | ||
| 43 | return true; | ||
| 44 | } | ||
| 45 | } | ||
| 46 | return false; | ||
| 47 | } | ||
| 48 | |||
| 28 | // If the size of this is too small, it ends up creating a soft cap on FPS as the renderer will have | 49 | // If the size of this is too small, it ends up creating a soft cap on FPS as the renderer will have |
| 29 | // to wait on available presentation frames. | 50 | // to wait on available presentation frames. |
| 30 | constexpr std::size_t SWAP_CHAIN_SIZE = 3; | 51 | constexpr std::size_t SWAP_CHAIN_SIZE = 3; |
| @@ -56,7 +77,7 @@ public: | |||
| 56 | std::deque<Frame*> present_queue; | 77 | std::deque<Frame*> present_queue; |
| 57 | Frame* previous_frame{}; | 78 | Frame* previous_frame{}; |
| 58 | 79 | ||
| 59 | FrameMailbox() : has_debug_tool{Device().HasDebugTool()} { | 80 | FrameMailbox() : has_debug_tool{HasDebugTool()} { |
| 60 | for (auto& frame : swap_chain) { | 81 | for (auto& frame : swap_chain) { |
| 61 | free_queue.push(&frame); | 82 | free_queue.push(&frame); |
| 62 | } | 83 | } |