ocl icon indicating copy to clipboard operation
ocl copied to clipboard

improvement for subbuffer

Open aleksander-mendoza opened this issue 3 years ago • 3 comments

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

aleksander-mendoza avatar Jun 22 '21 08:06 aleksander-mendoza

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 :)

c0gent avatar Feb 21 '23 23:02 c0gent

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.

aleksander-mendoza avatar Feb 22 '23 11:02 aleksander-mendoza

Ok thanks much.

c0gent avatar Feb 25 '23 00:02 c0gent