I am looking for anyone who has experience with OpenCL and OpenGL textures.
I have a set of textures, some of which are multi-sampled textures and other that are not.
If I create all my texures prior to creating the OpenCL context, OpenCL gives me zero values for all texures I bind to it.
If I create all my textures after creating the OpenCL context, I get errors trying to create the multi-sampling textures (I know I cannot access these in OpenCL).
If I create mulisampling textures, then create the OpenCL context, then create the other texures all is good.
However whenever I want to change the size of a multi-sampled texture, I have to destroy the OpenCl context and all my other textures and re-create them which is painfully slow.
I am looking for help on a more efficeint way of doing this
there is requirement that you must create OpenCL context before cratating OpenGL resources which you want share.
that explains why I have to create the shared textures after creating the OpenCL context; but do you have any idea why I get an error trying to create the mutli-sample texture after the OpenCL context has been created.
you got errors on which side? OpenGL or OpenCL? but it sound like bug to me.
The following call
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 8, GL_RGBA, 8,8, GL_FALSE);
gives GL_OUT_OF_MEMORY error message if an OpenCL context is attached to the OpenGL context.
Interestingly internal format GL_DEPTH_COMPONENT24 does not give the error; but I don't think the multi-sampling is working on the the texture.