Skip to content

Helm fails to run when the Core OpenGL profile is used #19

@bepzi

Description

@bepzi

Commit e98fd4a introduced changes to the OpenGL module in order to fix builds of Vitalium, but ironically, I think these changes broke Helm, which I'm refactoring and porting to JUCE 6. The problem is caused by using the Core OpenGL profile:

bool initialiseOnRenderThread (OpenGLContext& c)
{
XWindowSystemUtilities::ScopedXLock xLock;
PFNGLXCREATECONTEXTATTRIBSARBPROC createContextAttribs;
int attribs[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 2,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};

Where if you build and run Helm with this fork of JUCE, it crashes on startup due to misusing glVertexAttribPointer:

./helm

# ...

Message: GL_INVALID_OPERATION in glVertexAttribPointer(no array object bound)
Source: API
Type: Error
ID: 2
Severity: High

Message: GL_INVALID_OPERATION in glVertexAttribPointer(no array object bound)
Source: API
Type: Error
ID: 2
Severity: High

Message: GL_INVALID_OPERATION in glDrawElements(no VAO bound)
Source: API
Type: Error
ID: 2
Severity: High

helm: ../../../src/editor_components/open_gl_background.cpp:151: virtual void OpenGLBackground::render(juce::OpenGLContext&): Assertion `glGetError() == 0' failed.
zsh: abort (core dumped)  ./standalone/builds/linux/build/helm

(I'm a bit rusty with my OpenGL, so I'm afraid I can't diagnose exactly why the Core profile rejects this until I read up on it some more.)

If instead of GLX_CONTEXT_CORE_PROFILE_BIT_ARB, you use GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, Helm runs normally without errors or warnings.

Now, obviously the real problem here is Helm's OpenGL code, not this fork of JUCE. I intend to eventually look at it and figure out why it's not working, and rewrite it so that it's compliant with the Core profile. But I figured it was worth mentioning because it seems like a deviation from vanilla JUCE (Helm works fine if you replace juce_OpenGL_linux_X11.h with the current vanilla version), so this change might be breaking for other plugins with dubious OpenGL code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions