Commit 5c8113d3 by Luc Ferron Committed by Commit Bot

Vulkan/D3D11: Improve blit framebuffer tests and fix bug in D3D11

- Improving the tests revealed a bug in D3D 11 Fast Path rendering. - These changes here are preliminary to implementing the blit for depth/stencil in Vulkan when using the viewport flipping. Bug: angleproject:2673 Bug: angleproject:2719 Change-Id: I6d55084e559d3110c8eeb0e7acb4e6fb09b6c1b5 Reviewed-on: https://chromium-review.googlesource.com/1132125Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
parent a6a7842f
......@@ -330,21 +330,37 @@ gl::Error Framebuffer11::blitImpl(const gl::Context *context,
{
const gl::FramebufferAttachment *readBuffer = sourceFramebuffer->getDepthOrStencilbuffer();
ASSERT(readBuffer);
RenderTargetD3D *readRenderTarget = nullptr;
ANGLE_TRY(readBuffer->getRenderTarget(context, &readRenderTarget));
ASSERT(readRenderTarget);
const bool invertSource = UsePresentPathFast(mRenderer, readBuffer);
gl::Rectangle actualSourceArea = sourceArea;
if (invertSource)
{
RenderTarget11 *readRenderTarget11 = GetAs<RenderTarget11>(readRenderTarget);
actualSourceArea.y = readRenderTarget11->getHeight() - sourceArea.y;
actualSourceArea.height = -sourceArea.height;
}
const gl::FramebufferAttachment *drawBuffer = mState.getDepthOrStencilAttachment();
ASSERT(drawBuffer);
RenderTargetD3D *drawRenderTarget = nullptr;
ANGLE_TRY(drawBuffer->getRenderTarget(context, &drawRenderTarget));
ASSERT(drawRenderTarget);
ANGLE_TRY(mRenderer->blitRenderbufferRect(context, sourceArea, destArea, readRenderTarget,
drawRenderTarget, filter, scissor, false,
blitDepth, blitStencil));
bool invertDest = UsePresentPathFast(mRenderer, drawBuffer);
gl::Rectangle actualDestArea = destArea;
if (invertDest)
{
RenderTarget11 *drawRenderTarget11 = GetAs<RenderTarget11>(drawRenderTarget);
actualDestArea.y = drawRenderTarget11->getHeight() - destArea.y;
actualDestArea.height = -destArea.height;
}
ANGLE_TRY(mRenderer->blitRenderbufferRect(context, actualSourceArea, actualDestArea,
readRenderTarget, drawRenderTarget, filter,
scissor, false, blitDepth, blitStencil));
}
ANGLE_TRY(markAttachmentsDirty(context));
......
......@@ -485,6 +485,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context,
{
if (flipSource || contextVk->isViewportFlipEnabledForReadFBO())
{
// TODO(lucferron): Implement this http://anglebug.com/2673
// The tests in BlitFramebufferANGLETest are passing, but they are wrong since they
// use a single color for the depth / stencil buffers, it looks like its working,
// but if it was a gradient or a checked board, you would realize the flip isn't
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment