1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add support for glObjectLabel to aid debugging

This commit is contained in:
sfan5 2024-12-29 19:24:33 +01:00
parent d2004d32f6
commit 9554e3d43a
9 changed files with 56 additions and 12 deletions

View file

@ -164,13 +164,6 @@ COpenGL3DriverBase::COpenGL3DriverBase(const SIrrlichtCreationParameters &params
ExposedData = ContextManager->getContext();
ContextManager->activateContext(ExposedData, false);
GL.LoadAllProcedures(ContextManager);
if (EnableErrorTest && GL.IsExtensionPresent("GL_KHR_debug")) {
GL.Enable(GL_DEBUG_OUTPUT);
GL.DebugMessageCallback(debugCb, this);
} else if (EnableErrorTest) {
os::Printer::log("GL debug extension not available");
}
initQuadsIndices();
TEST_GL_ERROR(this);
}
@ -248,6 +241,20 @@ bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32> &screenS
initFeatures();
printTextureFormats();
if (EnableErrorTest) {
if (KHRDebugSupported) {
GL.Enable(GL_DEBUG_OUTPUT);
GL.DebugMessageCallback(debugCb, this);
} else {
os::Printer::log("GL debug extension not available");
}
} else {
// don't do debug things if they are not wanted (even if supported)
KHRDebugSupported = false;
}
initQuadsIndices();
// reset cache handler
delete CacheHandler;
CacheHandler = new COpenGL3CacheHandler(this);
@ -1615,7 +1622,7 @@ s32 COpenGL3DriverBase::addHighLevelShaderMaterial(
s32 nr = -1;
COpenGL3MaterialRenderer *r = new COpenGL3MaterialRenderer(
this, nr, vertexShaderProgram,
pixelShaderProgram,
pixelShaderProgram, shaderName,
callback, baseMaterial, userData);
r->drop();