ocl
ocl copied to clipboard
improvement for subbuffer
Hey, I think you might like this improvement. At least I'd really love this being added, because without it the API is not safe and can crash when someone attempts to build sub-buffer of sub-buffer
Apologies for not responding to this sooner.
It's been a while since I've looked at this code. Any chance you could explain your changes?
After this much time you've probably forgotten too. Either way no worries and thanks anyway :)
This code caused crashes. It's been long time and I don't have the code that could reproduce this anymore but essentially if you try to make subbuffer of a subbuffer then core::create_sub_buffer
calls some illegal operation and crashes (tried on OS X). My fix checks for this scenario and runs the correct sequence of functions. Instead of making subbuffer of subbuffer it creates a subbufer of the parent buffer with the appropriate offset being sum of parent offset and new subbufer offset.
Ok thanks much.