Force shader feedback before clear-before-draw overlay on vulkan

* The shader feedback itself will potentially trigger a replay. If this happens
  after the overlay is processed when fetching the pipeline state it will undo
  the clear-before. To workaround this without a huge and unnecessary refactor,
  we just triggere the shader feedback cache before doing a clear-before
  overlay. The amount of work is the same it just happens in a different place.
This commit is contained in:
baldurk
2021-02-22 12:38:43 +00:00
parent c6be4f7834
commit 3025cf66c6
+8
View File
@@ -1893,6 +1893,14 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
size_t startEvent = 0;
// this is a bit of a hack, but it's the simplest fix without refactoring the ClearBefore..
// overlay to copy the result off into the overlay texture (which has its own issues with
// alpha channels since the overlay expects to be blended). If we are selecting a new event
// with ClearBeforeDraw enabled then we do this here, and then later the pipeline is fetched
// and that triggers the bindless feedback - which will reset the state and undo our clear. If
// we force it to be cached here then it won't mess things up later.
FetchShaderFeedback(eventId);
// if we're ClearBeforePass the first event will be a vkBeginRenderPass.
// if there are any other events, we need to play up to right before them
// so that we have all the render state set up to do