diff --git a/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp b/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp index 7ddd1360..8f977fa9 100644 --- a/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp +++ b/MG/MG_GL/Implementations/EGL/Diligent/EGL_impl.cpp @@ -701,6 +701,22 @@ namespace MG_EGL::Diligent { if (MG_Diligent::g_pDevice && MG_Diligent::g_pContext) { MG_Util::Debug::LogD("Vulkan device created: device=%p, context=%p", MG_Diligent::g_pDevice, MG_Diligent::g_pContext); + auto version = MG_Diligent::g_pDevice->GetDeviceInfo().APIVersion; + std::string apiVersion; + switch (MG_Diligent::DILIGENT_BACKEND_TYPE) { + case MG_Constants::Backend::BACKEND_DILIGENT_VULKAN: + apiVersion = std::format("Vulkan {}.{}", version.Major, version.Minor); + break; + case MG_Constants::Backend::BACKEND_DILIGENT_METAL: + apiVersion = std::format("Metal {}.{}", version.Major, version.Minor); + break; + case MG_Constants::Backend::BACKEND_DILIGENT_OPENGL: + apiVersion = std::format("OpenGL {}.{}", version.Major, version.Minor); + break; + default: + apiVersion = ""; + } + MG_Util::Debug::LogD("Running on %s, %s", MG_Diligent::g_pDevice->GetAdapterInfo().Description, apiVersion.c_str()); } else { MG_Util::Debug::LogE("Failed to create Vulkan device"); } diff --git a/MG/MG_GL/Implementations/GL/Getter/BackendInfo.cpp b/MG/MG_GL/Implementations/GL/Getter/BackendInfo.cpp index c1ab0a2a..e25a5600 100644 --- a/MG/MG_GL/Implementations/GL/Getter/BackendInfo.cpp +++ b/MG/MG_GL/Implementations/GL/Getter/BackendInfo.cpp @@ -51,6 +51,53 @@ namespace MG_GL::Getter { #endif } + const std::string GetBackendGfxAPIName() { +#if BACKEND_TYPE == BACKEND_VULKAN + return "Vulkan"; +#elif BACKEND_TYPE == BACKEND_METAL + return "Metal"; +#elif BACKEND_TYPE == BACKEND_GLES + return "OpenGL ES"; +#elif BACKEND_TYPE == BACKEND_DILIGENT + switch (MG_Diligent::DILIGENT_BACKEND_TYPE) { + case MG_Constants::Backend::BACKEND_DILIGENT_VULKAN: + return "Vulkan"; + case MG_Constants::Backend::BACKEND_DILIGENT_METAL: + return "Metal"; + case MG_Constants::Backend::BACKEND_DILIGENT_OPENGL: + return "OpenGL"; + default: + return ""; + } +#else + return ""; +#endif + } + + const std::string GetGPUName() { +#if BACKEND_TYPE == BACKEND_DILIGENT + return MG_Diligent::g_pDevice->GetAdapterInfo().Description; +#else + return ""; +#endif + } + + const uint32_t GetBackendGfxAPIVersionMajor() { +#if BACKEND_TYPE == BACKEND_DILIGENT + return MG_Diligent::g_pDevice->GetDeviceInfo().APIVersion.Major; +#else + return 0; +#endif + } + + const uint32_t GetBackendGfxAPIVersionMinor() { +#if BACKEND_TYPE == BACKEND_DILIGENT + return MG_Diligent::g_pDevice->GetDeviceInfo().APIVersion.Minor; +#else + return 0; +#endif + } + void LogMGInfo() { std::string MGName = MG_GL::Getter::GetMGName() + " (MobileGL Core)"; diff --git a/MG/MG_GL/Implementations/GL/Getter/BackendInfo.h b/MG/MG_GL/Implementations/GL/Getter/BackendInfo.h index 38203e03..d44c9af3 100644 --- a/MG/MG_GL/Implementations/GL/Getter/BackendInfo.h +++ b/MG/MG_GL/Implementations/GL/Getter/BackendInfo.h @@ -8,7 +8,11 @@ #include "../../../../Includes.h" namespace MG_GL::Getter { + const std::string GetGPUName(); const std::string GetBackendName(); + const std::string GetBackendGfxAPIName(); + const uint32_t GetBackendGfxAPIVersionMajor(); + const uint32_t GetBackendGfxAPIVersionMinor(); const std::string GetMGName(); void LogMGInfo(); } diff --git a/MG/MG_GL/Implementations/GL/Getter/GL_Getter.cpp b/MG/MG_GL/Implementations/GL/Getter/GL_Getter.cpp index e53f3c21..e950b7a5 100644 --- a/MG/MG_GL/Implementations/GL/Getter/GL_Getter.cpp +++ b/MG/MG_GL/Implementations/GL/Getter/GL_Getter.cpp @@ -15,7 +15,7 @@ namespace MG_GL::GL { MG_Util::Debug::LogD("glGetString, name: %s", MG_Util::Debug::GLEnumToString(name)); switch (name) { case GL_VENDOR: - return (const GLubyte *)"MobileGL-Dev"; + return (const GLubyte *)"MobileGL-Dev (BZLZHH, Swung0x48, Tungsten)"; case GL_VERSION: { static std::string versionStr; if (versionStr.empty()) { @@ -44,7 +44,11 @@ namespace MG_GL::GL { } return (const GLubyte *)rendererString.c_str(); */ - return (const GLubyte *)(MG_GL::Getter::GetMGName() + " (MobileGL Core) Renderer").c_str(); + return (const GLubyte *)std::format("{} | {} {}.{}", + MG_GL::Getter::GetGPUName(), + MG_GL::Getter::GetBackendGfxAPIName(), + MG_GL::Getter::GetBackendGfxAPIVersionMajor(), + MG_GL::Getter::GetBackendGfxAPIVersionMinor()).c_str(); } case GL_SHADING_LANGUAGE_VERSION: return (const GLubyte *) "4.50 MobileGL with glslang";