mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Fix] (DiligentEngine): Fix some miscellaneous issues.
This commit is contained in:
@@ -380,6 +380,14 @@ namespace MG_GL::GL {
|
||||
}
|
||||
|
||||
void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices) {
|
||||
if (MG_Diligent::IsInRenderPass) {
|
||||
MG_Util::Debug::LogD("Ending current render pass.");
|
||||
MG_Diligent::g_pContext->EndRenderPass();
|
||||
MG_Diligent::IsInRenderPass = false;
|
||||
MG_Util::Debug::LogD("Current render pass ended.");
|
||||
} else {
|
||||
MG_Util::Debug::LogD("No active render pass to end.");
|
||||
}
|
||||
GLuint program = MG_State::GetCurrentProgram();
|
||||
MG_Util::Debug::LogD("DrawElements called with mode: %d, count: %d, type: %d, program: %u", mode, count, type, program);
|
||||
if (program == 0) {
|
||||
@@ -499,7 +507,6 @@ namespace MG_GL::GL {
|
||||
|
||||
EnsureRenderPassActive();
|
||||
MG_Diligent::g_pContext->DrawIndexed(drawAttrs);
|
||||
|
||||
MG_Diligent::g_pContext->EndRenderPass();
|
||||
MG_Diligent::IsInRenderPass = false;
|
||||
MG_Util::Debug::LogD("DrawIndexed completed.");
|
||||
|
||||
@@ -260,6 +260,8 @@ namespace MG_GL::GL {
|
||||
if (MG_Diligent::g_ShaderMap.find(shaderId) == MG_Diligent::g_ShaderMap.end() || MG_Diligent::g_ShaderMap[shaderId] == nullptr) {
|
||||
GLenum shaderType = shaderObj.type;
|
||||
std::string sourceStr = shaderSources[shaderId];
|
||||
MG_Util::Debug::LogD("Shader ID: %u, type: %s\nConverted source:\n%s",
|
||||
shaderId, MG_Util::Debug::GLEnumToString(shaderType), sourceStr.c_str());
|
||||
|
||||
Diligent::ShaderCreateInfo ShaderCI;
|
||||
ShaderCI.Source = sourceStr.c_str();
|
||||
|
||||
Reference in New Issue
Block a user