Commit 62342590 by Kenneth Russell

Revert "Add workaround for flushing before readPixels."

This reverts commit 46c13a15. Seems to have introduced significant flakiness on the Windows AMD FYI bot. Reverting while investigating. Change-Id: I9cfdb09a4a0d792a0c5db76c8b0b9d3285c0695a Reviewed-on: https://chromium-review.googlesource.com/280365Tested-by: 's avatarKenneth Russell <kbr@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org>
parent 46c13a15
......@@ -44,8 +44,7 @@ struct Workarounds
: mrtPerfWorkaround(false),
setDataFasterThanImageUpload(false),
zeroMaxLodWorkaround(false),
useInstancedPointSpriteEmulation(false),
finishBeforeReadPixels(false)
useInstancedPointSpriteEmulation(false)
{}
// On some systems, having extra rendertargets than necessary slows down the shader.
......@@ -68,12 +67,6 @@ struct Workarounds
// To work around this, D3D11 FL9_3 has to use a different pointsprite
// emulation that is implemented using instanced quads.
bool useInstancedPointSpriteEmulation;
// On some GPUs, race conditions have been observed during ReadPixels where GPU rendering is
// completing at the same time that the pixels are being mapped. This workaround governs whether
// a renderer finish is performed just before the readback operation. For performance reasons,
// it must not be done when using a pixel pack buffer.
bool finishBeforeReadPixels;
};
}
......
......@@ -258,15 +258,6 @@ gl::Error FramebufferD3D::readPixels(const gl::State &state, const gl::Rectangle
return gl::Error(GL_INVALID_OPERATION, "invalid pixel store parameters in readPixels");
}
if (!packState.pixelBuffer.get() && mRenderer->getWorkarounds().finishBeforeReadPixels)
{
gl::Error error = mRenderer->finish();
if (error.isError())
{
return error;
}
}
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(format, type);
const gl::InternalFormat &sizedFormatInfo = gl::GetInternalFormatInfo(sizedInternalFormat);
GLuint outputPitch = sizedFormatInfo.computeRowPitch(type, area.width, packState.alignment, 0);
......
......@@ -3667,7 +3667,7 @@ void Renderer11::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap *outTextureC
Workarounds Renderer11::generateWorkarounds() const
{
return d3d11::GenerateWorkarounds(this);
return d3d11::GenerateWorkarounds(mRenderer11DeviceCaps.featureLevel);
}
void Renderer11::setShaderResource(gl::SamplerType shaderType, UINT resourceSlot, ID3D11ShaderResourceView *srv)
......
......@@ -260,7 +260,7 @@ class Renderer11 : public RendererD3D
bool colorBlit, bool depthBlit, bool stencilBlit);
bool isES3Capable() const;
const Renderer11DeviceCaps &getRenderer11DeviceCaps() const { return mRenderer11DeviceCaps; }
const Renderer11DeviceCaps &getRenderer11DeviceCaps() { return mRenderer11DeviceCaps; };
RendererClass getRendererClass() const override { return RENDERER_D3D11; }
......
......@@ -1236,15 +1236,13 @@ HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name)
#endif
}
Workarounds GenerateWorkarounds(const Renderer11 *renderer)
Workarounds GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel)
{
D3D_FEATURE_LEVEL featureLevel = renderer->getRenderer11DeviceCaps().featureLevel;
Workarounds workarounds;
workarounds.mrtPerfWorkaround = true;
workarounds.setDataFasterThanImageUpload = true;
workarounds.zeroMaxLodWorkaround = (featureLevel <= D3D_FEATURE_LEVEL_9_3);
workarounds.useInstancedPointSpriteEmulation = (featureLevel <= D3D_FEATURE_LEVEL_9_3);
workarounds.finishBeforeReadPixels = renderer->getVendorId() == VENDOR_ID_AMD;
return workarounds;
}
......
......@@ -24,7 +24,6 @@ class FramebufferAttachment;
namespace rx
{
class Renderer11;
class RenderTarget11;
struct Workarounds;
struct Renderer11DeviceCaps;
......@@ -279,7 +278,7 @@ void SetBufferData(ID3D11DeviceContext *context, ID3D11Buffer *constantBuffer, c
}
}
Workarounds GenerateWorkarounds(const Renderer11 *renderer);
Workarounds GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel);
}
......
......@@ -581,9 +581,6 @@ Workarounds GenerateWorkarounds()
workarounds.mrtPerfWorkaround = true;
workarounds.setDataFasterThanImageUpload = false;
workarounds.useInstancedPointSpriteEmulation = false;
// Flakiness has been observed in WebGL conformance tests using
// ReadPixels on all vendors' GPUs with the D3D9 backend.
workarounds.finishBeforeReadPixels = true;
return workarounds;
}
......
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