go-gl / gl

Go bindings for OpenGL (generated via glow)
MIT License
1.06k stars 72 forks source link

gl.BufferSubData() crashed #151

Open leyaocty opened 2 years ago

leyaocty commented 2 years ago

Hi,

I'm using the gl.BufferSubDate() to refresh an array uniform block for shaders. It's ok on Ubuntu but cashes on Windows everytime. Environment of gl is msys2(mingw64) on windows11, gpu is the AMD-6800 igpu.

Each time it can last seconds whlie everything looks good, and then it crashed with following message:

Exception 0xc0000005 0x0 0xc0002640e0 0x7ffeac1f3f90
PC=0x7ffeac1f3f90
signal arrived during external code execution

runtime.cgocall(0x7ff7097215f0, 0xc0007c9b80)
        D:/Program Files/Go/src/runtime/cgocall.go:157 +0x4a fp=0xc0007c9b58 sp=0xc0007c9b20 pc=0x7ff7095b436a
github.com/go-gl/gl/v4.6-compatibility/gl._Cfunc_glowBufferSubData(0x7ffead208740, 0x8a11, 0x0, 0x140, 0xc000263fc0)
        _cgo_gotypes.go:8606 +0x52 fp=0xc0007c9b80 sp=0xc0007c9b58 pc=0x7ff70966f952
github.com/go-gl/gl/v4.6-compatibility/gl.BufferSubData.func1(0x97a2a80?, 0xc0007b24c8?, 0x7ff7097a9260?, 0xc0007c9c01?)
        C:/Users/t1/go/pkg/mod/github.com/go-gl/gl@v0.0.0-20211210172815-726fda9656d6/v4.6-compatibility/gl/package.go:20701 +0x7e fp=0xc0007c9be0 sp=0xc0007c9b80 pc=0x7ff70967585e
github.com/go-gl/gl/v4.6-compatibility/gl.BufferSubData(0x97a2a80?, 0xc0007b24c8?, 0x10?, 0xc00015c120?)
        C:/Users/t1/go/pkg/mod/github.com/go-gl/gl@v0.0.0-20211210172815-726fda9656d6/v4.6-compatibility/gl/package.go:20701 +0x19 fp=0xc0007c9c10 sp=0xc0007c9be0 pc=0x7ff709675799

I am using gl.DebugMessageCallback() for debug messages but nothing captured before crashing.

Looking forward to your reply, thx!

markusheukelom commented 1 year ago

For other people running into similar issues.

Check that you import the correct OpenGL gl package. @leyaocty imported v4.6-compatibility/gl but maybe was not supported on windows and different version needs to be imported. Or different files import different versions.