Commit 682f9141 by Jamie Madill Committed by Commit Bot

Remove feedback loop support from back-end.

Front-end detection still in place and will be removed in a follow-up. Removes the Vulkan feature and the special clear handling. Bug: angleproject:4959 Change-Id: I5d44c3f7dbdb49d8aa0375f54b7148df09732ba2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2363208Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 9d8fd36d
......@@ -323,12 +323,6 @@ struct FeaturesVk : FeatureSetBase
"enable_precision_qualifiers", FeatureCategory::VulkanFeatures,
"Enable precision qualifiers in shaders", &members, "http://anglebug.com/3078"};
// Support Depth/Stencil rendering feedback loops by masking out the depth/stencil buffer.
// Manhattan uses this feature in a few draw calls.
Feature supportDepthStencilRenderingFeedbackLoops = {
"support_depth_stencil_rendering_feedback_loops", FeatureCategory::VulkanFeatures,
"Suport depth/stencil rendering feedback loops", &members, "http://anglebug.com/4490"};
// Desktop (at least NVIDIA) drivers prefer combining barriers into one vkCmdPipelineBarrier
// call over issuing multiple barrier calls with fine grained dependency information to have
// better performance. http://anglebug.com/4633
......
......@@ -43,7 +43,7 @@ class RenderTargetCache final : angle::NonCopyable
using RenderTargetArray = gl::AttachmentArray<RenderTargetT *>;
const RenderTargetArray &getColors() const;
RenderTargetT *getDepthStencil(bool allowFeedbackLoop) const;
RenderTargetT *getDepthStencil() const;
RenderTargetT *getColorDraw(const gl::FramebufferState &state, size_t colorIndex) const;
RenderTargetT *getColorRead(const gl::FramebufferState &state) const;
......@@ -56,7 +56,6 @@ class RenderTargetCache final : angle::NonCopyable
RenderTargetT *mReadRenderTarget = nullptr;
gl::AttachmentArray<RenderTargetT *> mColorRenderTargets = {};
// We only support a single Depth/Stencil RenderTarget currently.
bool mDepthStencilFeedbackLoop = false;
RenderTargetT *mDepthStencilRenderTarget = nullptr;
};
......@@ -112,9 +111,9 @@ const gl::AttachmentArray<RenderTargetT *> &RenderTargetCache<RenderTargetT>::ge
}
template <typename RenderTargetT>
RenderTargetT *RenderTargetCache<RenderTargetT>::getDepthStencil(bool allowFeedbackLoop) const
RenderTargetT *RenderTargetCache<RenderTargetT>::getDepthStencil() const
{
return (allowFeedbackLoop || !mDepthStencilFeedbackLoop) ? mDepthStencilRenderTarget : nullptr;
return mDepthStencilRenderTarget;
}
template <typename RenderTargetT>
......@@ -147,7 +146,6 @@ angle::Result RenderTargetCache<RenderTargetT>::updateDepthStencilRenderTarget(
const gl::Context *context,
const gl::FramebufferState &state)
{
mDepthStencilFeedbackLoop = state.hasDepthStencilFeedbackLoop();
return updateCachedRenderTarget(context, state.getDepthOrStencilAttachment(),
&mDepthStencilRenderTarget);
}
......
......@@ -432,7 +432,7 @@ RenderTarget11 *Framebuffer11::getFirstRenderTarget() const
}
}
return mRenderTargetCache.getDepthStencil(true);
return mRenderTargetCache.getDepthStencil();
}
} // namespace rx
......@@ -49,7 +49,7 @@ class Framebuffer11 : public FramebufferD3D
}
const RenderTarget11 *getCachedDepthStencilRenderTarget() const
{
return mRenderTargetCache.getDepthStencil(true);
return mRenderTargetCache.getDepthStencil();
}
RenderTarget11 *getFirstRenderTarget() const;
......
......@@ -61,7 +61,7 @@ angle::Result Framebuffer9::clearImpl(const gl::Context *context,
const ClearParameters &clearParams)
{
ANGLE_TRY(mRenderer->applyRenderTarget(context, mRenderTargetCache.getColors()[0],
mRenderTargetCache.getDepthStencil(true)));
mRenderTargetCache.getDepthStencil()));
const gl::State &glState = context->getState();
float nearZ = glState.getNearPlane();
......@@ -72,7 +72,7 @@ angle::Result Framebuffer9::clearImpl(const gl::Context *context,
mRenderer->setScissorRectangle(glState.getScissor(), glState.isScissorTestEnabled());
mRenderer->clear(clearParams, mRenderTargetCache.getColors()[0],
mRenderTargetCache.getDepthStencil(true));
mRenderTargetCache.getDepthStencil());
return angle::Result::Continue;
}
......
......@@ -50,7 +50,7 @@ class Framebuffer9 : public FramebufferD3D
const RenderTarget9 *getCachedDepthStencilRenderTarget() const
{
return mRenderTargetCache.getDepthStencil(true);
return mRenderTargetCache.getDepthStencil();
}
const gl::InternalFormat &getImplementationColorReadFormat(
......
......@@ -282,9 +282,7 @@ FramebufferVk::FramebufferVk(RendererVk *renderer,
: FramebufferImpl(state),
mBackbuffer(backbuffer),
mFramebuffer(nullptr),
mActiveColorComponents(0),
mSupportDepthStencilFeedbackLoops(
renderer->getFeatures().supportDepthStencilRenderingFeedbackLoops.enabled)
mActiveColorComponents(0)
{
mReadPixelBuffer.init(renderer, VK_BUFFER_USAGE_TRANSFER_DST_BIT, kReadPixelsBufferAlignment,
kMinReadPixelsBufferSize, true);
......@@ -422,33 +420,6 @@ angle::Result FramebufferVk::clearImpl(const gl::Context *context,
bool scissoredClear = scissoredRenderArea != getRotatedCompleteRenderArea(contextVk);
// Special case for rendering feedback loops: clears are always valid in GL since they don't
// sample from any textures.
if ((clearDepth || clearStencil) && mState.hasDepthStencilFeedbackLoop())
{
// We currently don't handle scissored clears with rendering feedback loops.
ANGLE_VK_CHECK(contextVk, !scissoredClear, VK_ERROR_INCOMPATIBLE_DRIVER);
RenderTargetVk *depthStencilRT = mRenderTargetCache.getDepthStencil(true);
vk::ImageHelper *image = &depthStencilRT->getImageForWrite();
ANGLE_TRY(contextVk->onImageTransferWrite(image->getAspectFlags(), image));
vk::CommandBuffer &commandBuffer = contextVk->getOutsideRenderPassCommandBuffer();
VkImageSubresourceRange range;
range.aspectMask = image->getAspectFlags();
range.baseMipLevel = depthStencilRT->getLevelIndex();
range.levelCount = 1;
range.baseArrayLayer = depthStencilRT->getLayerIndex();
range.layerCount = 1;
commandBuffer.clearDepthStencilImage(image->getImage(),
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
clearDepthStencilValue, 1, &range);
clearDepth = false;
clearStencil = false;
}
// If there is nothing to clear, return right away (for example, if asked to clear depth, but
// there is no depth attachment).
if (!clearColor && !clearDepth && !clearStencil)
......@@ -720,9 +691,7 @@ angle::Result FramebufferVk::readPixels(const gl::Context *context,
RenderTargetVk *FramebufferVk::getDepthStencilRenderTarget() const
{
// If we mask out depth/stencil feedback loops, do not allow the user to access the looped DS
// render target. Passing "false" to getDepthStencil forces a return of "nullptr" for loops.
return mRenderTargetCache.getDepthStencil(!mSupportDepthStencilFeedbackLoops);
return mRenderTargetCache.getDepthStencil();
}
RenderTargetVk *FramebufferVk::getColorDrawRenderTarget(size_t colorIndex) const
......@@ -1144,7 +1113,7 @@ angle::Result FramebufferVk::blit(const gl::Context *context,
if (blitDepthBuffer || blitStencilBuffer)
{
RenderTargetVk *readRenderTarget = srcFramebufferVk->getDepthStencilRenderTarget();
RenderTargetVk *drawRenderTarget = mRenderTargetCache.getDepthStencil(true);
RenderTargetVk *drawRenderTarget = mRenderTargetCache.getDepthStencil();
UtilsVk::BlitResolveParameters params = commonParams;
params.srcLayer = readRenderTarget->getLayerIndex();
......@@ -1446,7 +1415,7 @@ angle::Result FramebufferVk::invalidateImpl(ContextVk *contextVk,
ANGLE_TRY(flushDeferredClears(contextVk, getRotatedCompleteRenderArea(contextVk)));
const auto &colorRenderTargets = mRenderTargetCache.getColors();
RenderTargetVk *depthStencilRenderTarget = mRenderTargetCache.getDepthStencil(true);
RenderTargetVk *depthStencilRenderTarget = mRenderTargetCache.getDepthStencil();
// To ensure we invalidate the right renderpass we require that the current framebuffer be the
// same as the current renderpass' framebuffer. E.g. prevent sequence like:
......
......@@ -255,7 +255,6 @@ class FramebufferVk : public FramebufferImpl
vk::FramebufferDesc mCurrentFramebufferDesc;
std::unordered_map<vk::FramebufferDesc, vk::FramebufferHelper> mFramebufferCache;
bool mSupportDepthStencilFeedbackLoops;
vk::ClearValuesArray mDeferredClears;
};
......
......@@ -1822,8 +1822,6 @@ void RendererVk::initFeatures(DisplayVk *displayVk, const ExtensionNameList &dev
// Currently disabled by default: http://anglebug.com/3078
ANGLE_FEATURE_CONDITION(&mFeatures, enablePrecisionQualifiers, false);
ANGLE_FEATURE_CONDITION(&mFeatures, supportDepthStencilRenderingFeedbackLoops, false);
ANGLE_FEATURE_CONDITION(&mFeatures, preferAggregateBarrierCalls, isNvidia || isAMD || isIntel);
// Currently disabled by default: http://anglebug.com/4324
......
......@@ -1658,11 +1658,9 @@ TEST_P(FramebufferTest_ES3, AttachmentStateChange)
// The test emulates the read-only feedback loop in Manhattan.
TEST_P(FramebufferTest_ES3, ReadOnlyDepthFeedbackLoopSupported)
{
// Feedback loops not supported on D3D11 and may not ever be.
ANGLE_SKIP_TEST_IF(IsD3D11());
// Also this particular test doesn't work on Android despite similar support in Manhattan.
ANGLE_SKIP_TEST_IF(IsAndroid() && IsOpenGLES());
// Feedback loops are only supported on Vulkan.
// TODO(jmadill): Make GL extension. http://anglebug.com/4969
ANGLE_SKIP_TEST_IF(!IsVulkan());
constexpr GLuint kSize = 2;
glViewport(0, 0, kSize, kSize);
......@@ -1725,11 +1723,9 @@ void main()
// Tests corner cases with read-only depth-stencil feedback loops.
TEST_P(FramebufferTest_ES3, ReadOnlyDepthFeedbackLoopStateChanges)
{
// Feedback loops not supported on D3D11 and may not ever be.
ANGLE_SKIP_TEST_IF(IsD3D11());
// Also this particular test doesn't work on Android despite similar support in Manhattan.
ANGLE_SKIP_TEST_IF(IsAndroid() && IsOpenGLES());
// Feedback loops are only supported on Vulkan.
// TODO(jmadill): Make GL extension. http://anglebug.com/4969
ANGLE_SKIP_TEST_IF(!IsVulkan());
constexpr GLuint kSize = 2;
glViewport(0, 0, kSize, kSize);
......
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