Hello! There was a question about performance. I tried to combine (if possible) the shaders into one for rendering in one pass. For example, SSR and Bloom (search for bright areas), blur: DOF and Bloom. But now there is a need to put the output in textures of different sizes. This raises the question: if I split all the shaders (postprocessing) and render the image in several passes (for example, ssr → bloom → blur bloom → blur dof instead of screenspace (ssr and bloom) → blur (bloom and dof)), how much performance can suffer? And in general, merging shaders for rendering in one pass, good practice? I will be grateful for the answer
Separation of shaders
It depends on several things and combining multiple shaders into one can be worse in some cases. In your case, if you want to output into different resolutions, it is likely better to have separate shaders.
Combining multiple shaders into one will be helpful if you are bottlenecked by texture sampling/writing bandwidth. Otherwise, it will increase register usage in the shader and that can affect negatively how the GPU can parallelize the wavefronts (group of threads running a single shader). Because if one shader uses a lot of registers, then it will limit the amount of concurrent shaders that can be started on the GPU at the same time (this is called occupancy).
To determine your bottleneck, you should use a GPU profiling tool such as Nvidia Nsight, AMD's GPU Perfstudio or Intel's Graphics Performance Analyzer.