pyopengl icon indicating copy to clipboard operation
pyopengl copied to clipboard

glClear causes segmentation fault on OSMesa and OpenGL 2

Open sabtorres opened this issue 6 years ago • 1 comments

What the title says. My context is initialized like this

    shared_win = None
    ctx = mesa.OSMesaCreateContext(GL_RGB, shared_win)
    win = ctx
    buf = arrays.GLubyteArray.zeros((height, width, 3))
    mesap = arrays.ArrayDatatype.dataPointer(buf)
    assert(mesa.OSMesaMakeCurrent(ctx, GLuint(mesap), GL_UNSIGNED_BYTE, width, height))

Apparently I can only use OSMesa with OpenGL 2, otherwise I wouldn't be using it.

I'm using Linux openSUSE Tumbleweed with Mesa drivers version 19.1.5.

sabtorres avatar Sep 19 '19 15:09 sabtorres

AFAICS you are simply using an unsupported mode for Mesa, though I can only guess that by creating my own test script which I've added on the develop branch. It does everything you're doing, but using RGBA mode instead of RGB. Your sample code doesn't call glClear, obviously, but the code does run to completion on Kubuntu 18.04.

You will find a working offscreen rendering test in tests/osdemo.py in the pyopengl repo.

mcfletch avatar Dec 28 '19 16:12 mcfletch