This is a list of TODOs and ideas for improving GPU subdivision support (D12406).
TODOs
- Investigate if read and write operations can be made more coherent.
- Investigate if compute dispatch size can be improved, to avoid too many calls.
- Remove some useless OpenGL initialization from OpenSubDiv
- We use our own patch evaluation shader, however we are still forced to compile the one from OpenSubDiv. This will require to implement our own GLComputeEvaluator.
- GLVertexBuffer also initializes the OpenGL library. We can avoid this by using our own vertex buffer wrapper.
- Compressed data structures for reducing memory usage
- Using compute shaders forces us to only deal with ints and floats. However, this is using more memory than necessary (e.g. for normals).
- This requires to do manual bit packing in the shaders, we need to pay good attention to alignements and data types (int vs. uint).
- Use multithreading for CPU tasks when applicable
- We still process some data on the CPU (e.g. polygons to materials map, edit mode flags). Although they are based on the coarse mesh, we could use multithreading to speed things up if needed.
Ideas
- Heuristic to disable GPU subdivision for small meshes, if they are hindering performance
- The mesh wrapper used for on the CPU might not need all of the data to be subdivided (e.g. we do not need vertex colors for snapping), we could potentially speed up CPU subdivision by only subdividing what we need.
- Potentially evaluate points on the GPU and copy back to the CPU side, this would require threads to have their own GL context.
- See if OpenSubDiv data structures can be shared between the CPU and GPU code (e.g. the stencils buffers) so that we do not have to create duplicate versions when the CPU side mesh is requested.
Vulkan
- OpenSubDiv does not yet officially support Vulkan. The Pixar team seem to already have something working internally (https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1153). It is not clear when this will be released.