OpenGL: Print more debug info at init time

This commit is contained in:
sfan5
2024-02-21 18:58:42 +01:00
parent 602a4050b5
commit 9f2d13a2b6
4 changed files with 32 additions and 8 deletions

View File

@ -205,7 +205,7 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
// print renderer information
VendorName = GL.GetString(GL_VENDOR);
os::Printer::log(VendorName.c_str(), ELL_INFORMATION);
os::Printer::log("Vendor", VendorName.c_str(), ELL_INFORMATION);
Version = getVersionFromOpenGL();
}
@ -222,6 +222,7 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
{
initVersion();
initFeatures();
printTextureFormats();
// reset cache handler
delete CacheHandler;
@ -276,6 +277,22 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
return true;
}
void COpenGL3DriverBase::printTextureFormats()
{
char buf[128];
for (u32 i = 0; i < static_cast<u32>(ECF_UNKNOWN); i++) {
auto &info = TextureFormats[i];
if (!info.InternalFormat) {
snprintf_irr(buf, sizeof(buf), "%s -> unsupported", ColorFormatNames[i]);
} else {
snprintf_irr(buf, sizeof(buf), "%s -> %#06x %#06x %#06x%s",
ColorFormatNames[i], info.InternalFormat, info.PixelFormat,
info.PixelType, info.Converter ? " (c)" : "");
}
os::Printer::log(buf, ELL_DEBUG);
}
}
void COpenGL3DriverBase::loadShaderData(const io::path& vertexShaderName, const io::path& fragmentShaderName, c8** vertexShaderData, c8** fragmentShaderData)
{
io::path vsPath(OGLES2ShaderPath);