-
Notifications
You must be signed in to change notification settings - Fork 87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems good
I tested this PR on Windows together with minetest/minetest#13321, it crashed on startup. I hope this output from "Microsoft (R) Windows Debugger" helps a bit. I had to skip through tons of "Debug Assertion Failed!" before it got to the actual crash. Output:
Stacktrace:
|
@grorp diff --git a/source/Irrlicht/OpenGL/Driver.cpp b/source/Irrlicht/OpenGL/Driver.cpp
index 6a8217e6..5294e481 100644
--- a/source/Irrlicht/OpenGL/Driver.cpp
+++ b/source/Irrlicht/OpenGL/Driver.cpp
@@ -1106,14 +1106,17 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
void COpenGL3DriverBase::beginDraw(const VertexType &vertexType, uintptr_t verticesBase)
{
+ printf("beginDraw({%d", vertexType.VertexSize);
for (auto attr: vertexType) {
GL.EnableVertexAttribArray(attr.Index);
+ printf(", {%d, %d, %#04x, %d, %d}", attr.Index, attr.ComponentCount, attr.ComponentType, attr.mode, attr.Offset);
switch (attr.mode) {
case VertexAttribute::Mode::Regular: GL.VertexAttribPointer(attr.Index, attr.ComponentCount, attr.ComponentType, GL_FALS>
case VertexAttribute::Mode::Normalized: GL.VertexAttribPointer(attr.Index, attr.ComponentCount, attr.ComponentType, GL_T>
case VertexAttribute::Mode::Integral: GL.VertexAttribIPointer(attr.Index, attr.ComponentCount, attr.ComponentType, verte>
}
}
+ printf("}, %p)\n", (void*)verticesBase);
}
void COpenGL3DriverBase::endDraw(const VertexType &vertexType) |
Also am I right you’re testing an MSVC build? MinGW build may behave differently. |
Yes, I am.
|
Thanks. Now it’s clear what happens: the
|
I replaced |
Works 👍 |
This PR replaces all direct calls to the OpenGL library from the unified driver with calls via OpenGLProcedures. There are also a few fixes required for it to compile.
This is inspired by #232 but is much simpler. Also not all calls are replaced, those in e.g. COpenGLCoreTexture (shared with other drivers) remain. That shouldn’t be a problem as these drivers do that too and work (it might be the cause of some obscure bugs though).
I can’t test whether this Windows/SDL build actually works but given that it didn’t even compile, it is definitely better than before ;)