Closed doug-moen closed 5 years ago
I don't think this is a problem with FragM code.
check in file xorg.conf for...
Section "DRI" mode 0666 EndSection
the mode may be different for your setup.
FragM uses some specialized tricks, works very well on nVidia cards using the drivers supplied by nVidia. Mesa (software renderer) and nouveau (opensource GL driver) are not guaranteed to work, your card should support GL 4.1 compatibility profile for best results.
search "problem Intel GPU glGetString" on google for more information.
Try setting the environment MESA_GL_VERSION_OVERRIDE=4.6COMPAT
, this may allow FragM to start, and postpone the crash until new features are really used.
IMHO segfault is always a bug and should be fixed, even if it is just to print a message and abort()
.
@claudeha Thanks. An error message indicating that my driver doesn't support the right version of OpenGL, and telling me what version is needed, would have been helpful. On my system, glxinfo says:
Max core profile version: 4.2
Max compat profile version: 3.0
So if version 4.6 is the actual requirement, then I need to install a more recent GPU driver.
The "MESA_GL_VERSION_OVERRIDE=4.6COMPAT" trick works. It gets far enough to open a GUI window without crashing.
"MESA_GL_VERSION_OVERRIDE=4.1COMPAT" also works, and 3Dickulus did say that the requirement is OpenGL 4.1 compat.
This crashes with a core dump: "MESA_GL_VERSION_OVERRIDE=4.0COMPAT".
in the code it requests 4.1 compat but after initialization, on nv gt760, it returns 4.6 compat ??? Qt says this is the best way to do it for the widest compatibility guaranteeing that you get a version that encompasses the requested version.
"Compat" means backward compatible with OpenGL 2.1 and earlier, it doesn't mean compatible with more GPUs. On the Macintosh, you can't get a compatibility context more recent than 2.1, but you can get a 4.1 core context. Similarly, on Ubuntu 16.04 with the Intel driver, you can't get a compatibility context more recent than 3.0, but you can get a 4.2 core context. In my project, I switched from using a compatibility context to using a core context so that my code would run on a wider variety of systems.
You lose some old deprecated features when switching to a core context. So when I made this switch, I had to make a few code changes. In my fragment shader, the built-in variable "glFragColor" goes away, but variable names beginning with "gl" are reserved, so I had to replace it with an out variable of a different name:
Also, in my vertex shader, the keywords "attribute" and "varying" changed to "in" and "out".
These changes are a bigger deal in Fragmentarium than in my project, due to all of the user-defined shaders, but maybe you would use the preprocessor to hide these GLSL name changes.
Eg, #define gl_FragColor oFragColour
.
yes I understand, 4.6 compat covers everything in 4.1 core plus earlier deprecated stuff, guarantees that it will handle 4.1, that's a Qt quirk. I am also aware that Mac has setup their OS+hardware for core profile only even though they use nVidia and should support it, it doesn't support compat profile, however, when Qt requests a 4.1 compat profile MacOS will return a working 4.1 core profile so at least it's possible to debug and get things working.
Fragmentarium was started Nov 8 2010 so it's 8 years old now, converting over to new GL and GLSL standards will require a complete rewrite and loose compatibility with the entire shader base, a huge project to refactor all of the frags and/or engine internals, in order to maintain backward compatability while updating the current code would make a mess imho, so my solution? is to use FragM as a repository of ideas that can serve as a guide for a new version that is up to current standards and can exploit new features. I would also use glFragColor to replace gl_FragColor.
Also the transition from older QGL to newer QOpenGL has caused many issues, I have managed to write in double types, dvec2/3/4 etc., and fix a few problems with textures, QOpenGLShader does not support double types natively so I use glCalls to make it happen, it would be better to derive a custom shader class from QOpenGLShader and add all the things it lacks, but I'm just one guy with a fulltime job so if you would like to work on a rewrite or refactoring the existing code I would be happy to work with you on that.
Great, thanks for all of that context. And thanks for your work on Fragmentarium.
Actually, I'm already working on a new system called Curv, and I'm looking at Fragmentarium as a source of ideas. But it won't be compatible with Fragmentarium, since models are written in a pure functional language that is compiled to GLSL, not in GLSL itself. I've manually translated some Fragmentarium models into the Curv language, and I'm hoping to learn some tricks from the code, like how progressive rendering is done.
that's the thing about coders, everyone wants to do their own thing, I had a look at Curv and it looks really interesting, a lot of potential there, it would be interesting to see if it could be used to create the user part of fragments in FragM, some of the original authors of fragments have released their code under various copyrights, most make no mention of any copyright as it's all experimental.
The crash occurs using the latest source code, but a snapshot from April had the same problem.
Here's the GDB trace. I modified the CMakeLists.txt file to perform a Debug build, in order to get a better stack trace. This trace is not different from the Release build trace, except it has better line number information:
Some information about my GPU and driver, from glxinfo: