This one is a bit confusing, also with GitHub - vinz9/CudaSortTOP: TouchDesigner TOP wrapper for Cuda Thrust sort_by_key function I’ve noticed that when the plugin is loaded as a custom op, not using the cplusplus TOP, even though the output format looks like what is set in getOutputFormat() (32 bit mono), the cooking time (4x slower) reflects another format (32 bit rgba).
Here is what I’m doing
bool
CudaSortTOP::getOutputFormat(TOP_OutputFormat* format, const OP_Inputs inputs, void reserved)
{
See this video (look at the format in the info as well as the cooking time, it goes from 1.3 to 6ms for the gpu when the plugin is loaded as a custom op)
Also, in general I was thinking using getoutputformat() is a bit confusing, since it creates a disconnect between what is selected on the common page of the OP and the actual output format.
Maybe the output format selection could be grayed out, or read only with a mention “set by OP”, on the common page when this is used?
Thanks for the reports! The slower performance is fixed, it was a memory allocation that was happening at the start of the cook, before it would then reallocate the texture to what getOutputFormat() requested.
pixelFormat is now filled in in all modes as well.
The weird way the pixel format is selected is a legacy thing from back when it was far more varied what each GPU supported. As part of the Vulkan work I’m going to replace this with a more direct pixel format selection.
Thanks for the bug fix Malcolm and thanks for the formats explanation!
Though in the end I reverted to displaying an error message if the wrong format was selected, as I felt the disconnect between what is selected on the common page of the OP and the actual output format, as said above.