1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 00:55:20 +02: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

@@ -161,10 +161,23 @@ public:
GL.BlendEquation(mode);
}
inline void irrGlObjectLabel(GLenum identifier, GLuint name, const char *label)
{
if (KHRDebugSupported) {
u32 len = strlen(label);
// Since our texture strings can get quite long we also truncate
// to a hardcoded limit of 82
len = std::min(len, std::min(MaxLabelLength, 82U));
GL.ObjectLabel(identifier, name, len, label);
}
}
bool LODBiasSupported = false;
bool AnisotropicFilterSupported = false;
bool BlendMinMaxSupported = false;
bool TextureMultisampleSupported = false;
bool KHRDebugSupported = false;
u32 MaxLabelLength = 0;
};
}