Hi!
What is the way to fill a opencl buffer (or texture) with zeros?
cl_int errorCode;
float arg = 0; //or a larger datastructure/type
errorCode = m_Queue->enqueueFillBuffer<float>(destinationBuffer,arg,0,size,NULL,0);
This operation seems really wasteful, but maybe I'm wrong? Is it perhaps better to use map/unmap and memset with zeros?
For example I want to create a buffer of size x, fill it with z amounts of data (z<x) and fill the rest of the buffer with zeros. Is the only option then to first write z data, and then do a fill-function call like the one above with an offset? Is it possible to intialize a buffer filled with zeros. Googling only seem to result in information about zero-copy memory (which is interesting in itself, but not what I'm looking for).