unified memory buffer shared with opencl, kaputt.

i asked about it on LWJGL forums but maybe you guys know …

just cannot figure out what exactly is going on … here’s how you can probably recreate the issue :

= all good

now with openCL :

  • upload some mesh
  • share with opencl (clCreateFromGLBuffer)
  • modify buffer with compute shader
  • dont use opencl yet at all
  • draw it

= not good, it is drawing the mesh fine but not the modification by compute shader.

now, the same applies to opencl as you’d guess.

  • share with opencl
  • modify buffer with opencl
  • draw

= same results, modification not visible.

using the “usual” way, non-resident with a VAO and glVertexPointer etc works just fine. with compute shader and opencl even at the same time.

what i do not understand is, since the resident buffer is readable/writeable fine from a compute shader, in what way is clCreateFromGLBuffer affecting or changing the buffer and how can we stop opencl from doing that ?

i tried releasing the cl-buffer just after clCreate, nothing. making it non-resident and resident again, nothing. for the compute shader it is kaputt until i destroy recreate the buffer. plain uploading and drawing is working fine all the time tho’ >:( = i guess the buffers gpu-address pointer is not changed, gpu would crash at least.

:persecutioncomplex: