MTLComputePipelineDescriptor has a new property `buffers` in the iOS 11 Beta. It's possible to set a buffer as immutable via the `mutability` property.
The documentation says:
"The Metal driver may perform certain optimizations if you specify that neither the CPU nor the GPU will modify a buffer's contents between the time the buffer is set in a function's argument table and the time its associated command buffer completes execution." [emphasis mine]
I'm confused. Isn't immutability of a buffer specified via the `constant` memory-layout keyword in a kernel function?
What is the difference between:
- specifying a buffer to be in the `constant` address space in a kernel function
- specifying the buffer to be immutable via the pipeline descriptor, as mentioned above?
Is the second approach better than the first, or should I combine them? Which is faster (and what does it depend on)?