Trying to put together a puzzle:
- Is it OK to use MTLRenderCommandEncoder not for rendering but for computing tasks?
- If not, does it possible to do vertex shader job using MTLComputeCommandEncoder?
Use case:
- Apply simultaneously 2x zoom effect & shake effect (with 10% of width offset) to the stored video file.
CodePudding user response:
You can process buffers (including vertex buffers) in compute shaders. There are tons of techniques that are using it: particle systems, custom tessellation from Unity in SIGGRAPH'22, cloth simulation and many others.
In addition to compute shaders in OpenGL there is transform feedback that allows you to use part of rendering pipeline (before rasterization). However, Metal does not provide API for it.