mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	Merge pull request #3958 from FernandoS27/gl-debug
OpenGL: Enable Debug Context and Synchronous debugging when graphics debugging is enabled
This commit is contained in:
		
						commit
						edbf3144d2
					
				@ -753,6 +753,9 @@ void RendererOpenGL::RenderScreenshot() {
 | 
				
			|||||||
bool RendererOpenGL::Init() {
 | 
					bool RendererOpenGL::Init() {
 | 
				
			||||||
    if (GLAD_GL_KHR_debug) {
 | 
					    if (GLAD_GL_KHR_debug) {
 | 
				
			||||||
        glEnable(GL_DEBUG_OUTPUT);
 | 
					        glEnable(GL_DEBUG_OUTPUT);
 | 
				
			||||||
 | 
					        if (Settings::values.renderer_debug) {
 | 
				
			||||||
 | 
					            glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        glDebugMessageCallback(DebugHandler, nullptr);
 | 
					        glDebugMessageCallback(DebugHandler, nullptr);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -106,6 +106,9 @@ public:
 | 
				
			|||||||
        format.setVersion(4, 3);
 | 
					        format.setVersion(4, 3);
 | 
				
			||||||
        format.setProfile(QSurfaceFormat::CompatibilityProfile);
 | 
					        format.setProfile(QSurfaceFormat::CompatibilityProfile);
 | 
				
			||||||
        format.setOption(QSurfaceFormat::FormatOption::DeprecatedFunctions);
 | 
					        format.setOption(QSurfaceFormat::FormatOption::DeprecatedFunctions);
 | 
				
			||||||
 | 
					        if (Settings::values.renderer_debug) {
 | 
				
			||||||
 | 
					            format.setOption(QSurfaceFormat::FormatOption::DebugContext);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        // TODO: expose a setting for buffer value (ie default/single/double/triple)
 | 
					        // TODO: expose a setting for buffer value (ie default/single/double/triple)
 | 
				
			||||||
        format.setSwapBehavior(QSurfaceFormat::DefaultSwapBehavior);
 | 
					        format.setSwapBehavior(QSurfaceFormat::DefaultSwapBehavior);
 | 
				
			||||||
        format.setSwapInterval(0);
 | 
					        format.setSwapInterval(0);
 | 
				
			||||||
 | 
				
			|||||||
@ -98,6 +98,9 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(Core::System& system, bool fullscreen)
 | 
				
			|||||||
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
 | 
					    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
 | 
				
			||||||
    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
 | 
					    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
 | 
				
			||||||
    SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
 | 
					    SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
 | 
				
			||||||
 | 
					    if (Settings::values.renderer_debug) {
 | 
				
			||||||
 | 
					        SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    SDL_GL_SetSwapInterval(0);
 | 
					    SDL_GL_SetSwapInterval(0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::string window_title = fmt::format("yuzu {} | {}-{}", Common::g_build_fullname,
 | 
					    std::string window_title = fmt::format("yuzu {} | {}-{}", Common::g_build_fullname,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user