Hi there,
I`m looking to pass pointer to same data or copy data from one top node to another
in this case cpu memory template.
did quick try, using 3 buffers - (not working)
would happy also for additional explanation on the 1-3 buffer trick and maybe link to
more examples.
thanks
B.
update while looking on my code :
- instead of char - should be unsigned char.
- did mistake between bits and bytes.
3.now it works.
still would happy for hints and explanations.
[code]{
if (myExecuteCount == 0)
{
textureMemoryLocation = 0;
}
unsigned char* mem = (unsigned char*)outputFormat->cpuPixelData[textureMemoryLocation];
OP_TOPInputDownloadOptions options;
options.cpuMemPixelType = OP_CPUMemPixelType::R8Fixed;
uint32_t sizeByte = inputs->getInputTOP(0)->width * inputs->getInputTOP(0)->height * sizeof(unsigned char);
unsigned char* topMem = (unsigned char*)inputs->getTOPDataInCPUMemory(inputs->getInputTOP(0), &options);
if (topMem == nullptr) {return; }
memcpy(mem, topMem, sizeByte);
//mem = topMem;
textureMemoryLocation = !myExecuteCount % 3;
outputFormat->newCPUPixelDataLocation = textureMemoryLocation;
myExecuteCount++;
}[/code]