What are the benefits of using immutable samplers in Vulkan?

Viewed 124

Am I mistaken that in the case of immutable sampler it's set into the pipeline descriptor layout, whereas a non-immutable descriptor is a pointer to a sampler, and so essentially a non-immutable sampler is one extra indirection to read data from it? What kind of performance increase are we talking?

1 Answers

If there is any performance increase, it would likely be quite trivial and heavily hardware and algorithm dependent.

Vulkan is an explicit, low-level API. This allows it to better match the hardware, but it also means that you get to specify more precisely what it is that you want to do. In the vast majority of cases, the sampler you're using with a texture will be fixed for that particular use. As such, the API allows you to explicitly state this. While this can potentially allow for some hardware optimization, the main thing it allows you to do is to stop carrying around VkSampler objects when you don't need them. You specify them in the set layout, and you're done.

Related