d3d12: reference surface resources in the current batch when clear is called on them
The surface clear command take a handle to the surface, and thereby indirectly reference the underlying resource. Therefore, the current batch must hold a reference at least to this resource. Otherwise, if no call to draw_vbo
follows, it might happen that st_manager
replaces and destroys the surface and resource before the command list was closed and executed.
We don't want to reference the surface itself though, because when surfaces are swapped out without draw calls the current batch doesn't reset, and we would keep hold on the surface needlessly long and would exhaust the view descriptor heap.
Both issues can be observed by running
.\deqp-gles2.exe --deqp-caselist-file=..\..\..\android\cts\master\gles2-master.txt
from the GLES CTS.