cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

danbartlett
Journeyman III

Acquiring + Releasing GL buffers performance

I created a simple CL/GL sharing app, and it didn't seem to be matching the performance of the demo provided in the SDK.

After some testing, I realised that the performance of acquiring + releasing the GL buffer object was impacted a lot by when the GL buffer object was created.

If the GL buffer object was created before the CL Context, the performance was MUCH lower.  I would get 40-50 FPS instead of 140-150 FPS when the GL buffer object was created after the CL Context.

// ------- slow --------------- glGenBuffers(1, &buf); glBindBuffer(...); glBufferData(..., GL_DYNAMIC_DRAW); context = clCreateContext(...); // from GL Context clCreateFromGLBuffer(context, CL_MEM_WRITE_ONLY, ...); // ------- fast --------------- context = clCreateContext(...); // from GL Context glGenBuffers(1, &buf); glBindBuffer(...); glBufferData(..., GL_DYNAMIC_DRAW); clCreateFromGLBuffer(context, CL_MEM_WRITE_ONLY, ...);

0 Likes
2 Replies
nou
Exemplar

there was article about OpenGL interoprability. and according to that article you must create every GL object AFTER creating CL context. IMHO there is fallback for this case and it copy through host memery which is slow.

0 Likes

Ah, thanks.  Good to know it's a known issue.  I found a reference to it in http://developer.amd.com/gpu/ATIStreamSDK/assets/ATI_Stream_SDK_Release_Notes_Developer.pdf (section 6.4)

0 Likes