Vulkan: Allow clearing the backbuffer to any color.

Helps with debugging sometimes.
This commit is contained in:
Unknown W. Brackets 2017-11-05 22:14:53 -08:00
parent de459e6a1d
commit 9dfc9ff6ae
2 changed files with 3 additions and 1 deletions

View File

@ -965,7 +965,6 @@ void EmuScreen::preRender() {
bool useBufferedRendering = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
if ((!useBufferedRendering && !g_Config.bSoftwareRendering) || Core_IsStepping()) {
// We need to clear here already so that drawing during the frame is done on a clean slate.
DrawContext *draw = screenManager()->getDrawContext();
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, 0xFF000000 });
Viewport viewport;

View File

@ -559,6 +559,9 @@ void VulkanQueueRunner::PerformBindFramebufferAsRenderTarget(const VKRStep &step
}
} else {
renderPass = GetBackbufferRenderPass();
assert(step.render.color == VKRRenderPassAction::CLEAR || step.render.color == VKRRenderPassAction::DONT_CARE);
assert(step.render.depthStencil == VKRRenderPassAction::CLEAR || step.render.depthStencil == VKRRenderPassAction::DONT_CARE);
Uint8x4ToFloat4(clearVal[0].color.float32, step.render.clearColor);
numClearVals = 2; // We don't bother with a depth buffer here.
clearVal[1].depthStencil.depth = 0.0f;
clearVal[1].depthStencil.stencil = 0;