Release the srbs of the internal passes with their draw call data
The depth pre-pass, the shadow map pass, the normal pass and the three
user pass variants built their shader resource bindings around the
uniform buffer of their draw call data, but only stored the resulting
srb on the renderable. Since the srb was never recorded in the draw
call data, releaseDrawCallData() could not purge it, so whenever the
draw call data was released, e.g. when a View3D or its window is
destroyed while the content lives on, the cached srb stayed behind
referencing the deleted uniform buffer. The cache grew with every
destroyed view, and a new buffer allocated at a recycled address could
pick up an srb built for the deleted one.
Record the srb in the draw call data, the same way the main pass
already does, so it is released when the bindings change or the draw
call data goes away.
All user passes share one pass key, so different user passes rendering
the same model and material shared a single draw call data entry. With
the srb stored there, one pass would release the srb another pass had
just prepared for the same frame. Add the user pass slot index to the
key so each pass gets its own entry; this also stops the passes from
sharing a uniform buffer.
Fixes: QTBUG-151125
Pick-to: 6.12 6.8
Change-Id: Ifc8ef37e7bdef45fb996568683e9801ae3393b51
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>