Commit 565bba3d by Kenneth Russell Committed by Angle LUCI CQ

Revert "GL: Skip redundant flushes."

This reverts commit 7a38f3f5. Reason for revert: caused numerous test failures on FYI waterfall per http://crbug.com/1213507 . Original change's description: > GL: Skip redundant flushes. > > Skip flushes when there is no work submitted since the last > flush. > > Clone of geofflang's: > https://chromium-review.googlesource.com/2911879 > > Bug: chromium:1181068 > Change-Id: Idd8a1c61b814d746bf1e0225cfc4ca375a7bb224 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2915675 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1181068 Bug: chromium:1213507 No-Try: True Change-Id: Icd1662e4ea541375b44bddaa839a5241cdad5302 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2919503 Commit-Queue: Kenneth Russell <kbr@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 17c45b65
......@@ -80,8 +80,6 @@ angle::Result BufferGL::setData(const gl::Context *context,
mBufferSize = size;
contextGL->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -91,7 +89,6 @@ angle::Result BufferGL::setSubData(const gl::Context *context,
size_t size,
size_t offset)
{
ContextGL *contextGL = GetImplAs<ContextGL>(context);
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -105,8 +102,6 @@ angle::Result BufferGL::setSubData(const gl::Context *context,
memcpy(mShadowCopy.data() + offset, data, size);
}
contextGL->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -116,7 +111,6 @@ angle::Result BufferGL::copySubData(const gl::Context *context,
GLintptr destOffset,
GLsizeiptr size)
{
ContextGL *contextGL = GetImplAs<ContextGL>(context);
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -136,14 +130,11 @@ angle::Result BufferGL::copySubData(const gl::Context *context,
memcpy(mShadowCopy.data() + destOffset, sourceGL->mShadowCopy.data() + sourceOffset, size);
}
contextGL->markWorkSubmitted();
return angle::Result::Continue;
}
angle::Result BufferGL::map(const gl::Context *context, GLenum access, void **mapPtr)
{
ContextGL *contextGL = GetImplAs<ContextGL>(context);
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -171,8 +162,6 @@ angle::Result BufferGL::map(const gl::Context *context, GLenum access, void **ma
mMapOffset = 0;
mMapSize = mBufferSize;
contextGL->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -182,7 +171,6 @@ angle::Result BufferGL::mapRange(const gl::Context *context,
GLbitfield access,
void **mapPtr)
{
ContextGL *contextGL = GetImplAs<ContextGL>(context);
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -203,14 +191,11 @@ angle::Result BufferGL::mapRange(const gl::Context *context,
mMapOffset = offset;
mMapSize = length;
contextGL->markWorkSubmitted();
return angle::Result::Continue;
}
angle::Result BufferGL::unmap(const gl::Context *context, GLboolean *result)
{
ContextGL *contextGL = GetImplAs<ContextGL>(context);
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -234,9 +219,6 @@ angle::Result BufferGL::unmap(const gl::Context *context, GLboolean *result)
}
mIsMapped = false;
contextGL->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -247,7 +229,6 @@ angle::Result BufferGL::getIndexRange(const gl::Context *context,
bool primitiveRestartEnabled,
gl::IndexRange *outRange)
{
ContextGL *contextGL = GetImplAs<ContextGL>(context);
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -279,8 +260,6 @@ angle::Result BufferGL::getIndexRange(const gl::Context *context,
}
}
contextGL->markWorkSubmitted();
return angle::Result::Continue;
}
......
......@@ -329,8 +329,6 @@ angle::Result ContextGL::drawArrays(const gl::Context *context,
ANGLE_GL_TRY(context, getFunctions()->drawArraysInstanced(ToGLenum(mode), first, count,
instanceCount));
}
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -350,8 +348,6 @@ angle::Result ContextGL::drawArraysInstanced(const gl::Context *context,
ANGLE_TRY(setDrawArraysState(context, first, count, adjustedInstanceCount));
ANGLE_GL_TRY(context, getFunctions()->drawArraysInstanced(ToGLenum(mode), first, count,
adjustedInstanceCount));
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -473,8 +469,6 @@ angle::Result ContextGL::drawArraysInstancedBaseInstance(const gl::Context *cont
resetUpdatedAttributes(attribToResetMask);
}
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -506,8 +500,6 @@ angle::Result ContextGL::drawElements(const gl::Context *context,
getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type),
drawIndexPtr, instanceCount));
}
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -540,8 +532,6 @@ angle::Result ContextGL::drawElementsBaseVertex(const gl::Context *context,
ToGLenum(mode), count, ToGLenum(type), drawIndexPtr,
instanceCount, baseVertex));
}
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -589,8 +579,6 @@ angle::Result ContextGL::drawElementsInstancedBaseVertex(const gl::Context *cont
ANGLE_GL_TRY(context, getFunctions()->drawElementsInstancedBaseVertex(
ToGLenum(mode), count, ToGLenum(type), drawIndexPointer,
adjustedInstanceCount, baseVertex));
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -637,8 +625,6 @@ angle::Result ContextGL::drawElementsInstancedBaseVertexBaseInstance(const gl::C
resetUpdatedAttributes(attribToResetMask);
}
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -668,8 +654,6 @@ angle::Result ContextGL::drawRangeElements(const gl::Context *context,
getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type),
drawIndexPointer, instanceCount));
}
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -701,8 +685,6 @@ angle::Result ContextGL::drawRangeElementsBaseVertex(const gl::Context *context,
ToGLenum(mode), count, ToGLenum(type), drawIndexPointer,
instanceCount, baseVertex));
}
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -711,8 +693,6 @@ angle::Result ContextGL::drawArraysIndirect(const gl::Context *context,
const void *indirect)
{
ANGLE_GL_TRY(context, getFunctions()->drawArraysIndirect(ToGLenum(mode), indirect));
mRenderer->markWorkSubmitted();
return angle::Result::Continue;
}
......@@ -732,8 +712,6 @@ angle::Result ContextGL::multiDrawArrays(const gl::Context *context,
const GLsizei *counts,
GLsizei drawcount)
{
mRenderer->markWorkSubmitted();
return rx::MultiDrawArraysGeneral(this, context, mode, firsts, counts, drawcount);
}
......@@ -744,8 +722,6 @@ angle::Result ContextGL::multiDrawArraysInstanced(const gl::Context *context,
const GLsizei *instanceCounts,
GLsizei drawcount)
{
mRenderer->markWorkSubmitted();
return rx::MultiDrawArraysInstancedGeneral(this, context, mode, firsts, counts, instanceCounts,
drawcount);
}
......@@ -757,8 +733,6 @@ angle::Result ContextGL::multiDrawElements(const gl::Context *context,
const GLvoid *const *indices,
GLsizei drawcount)
{
mRenderer->markWorkSubmitted();
return rx::MultiDrawElementsGeneral(this, context, mode, counts, type, indices, drawcount);
}
......@@ -770,8 +744,6 @@ angle::Result ContextGL::multiDrawElementsInstanced(const gl::Context *context,
const GLsizei *instanceCounts,
GLsizei drawcount)
{
mRenderer->markWorkSubmitted();
return rx::MultiDrawElementsInstancedGeneral(this, context, mode, counts, type, indices,
instanceCounts, drawcount);
}
......@@ -784,8 +756,6 @@ angle::Result ContextGL::multiDrawArraysInstancedBaseInstance(const gl::Context
const GLuint *baseInstances,
GLsizei drawcount)
{
mRenderer->markWorkSubmitted();
return rx::MultiDrawArraysInstancedBaseInstanceGeneral(
this, context, mode, firsts, counts, instanceCounts, baseInstances, drawcount);
}
......@@ -801,8 +771,6 @@ angle::Result ContextGL::multiDrawElementsInstancedBaseVertexBaseInstance(
const GLuint *baseInstances,
GLsizei drawcount)
{
mRenderer->markWorkSubmitted();
return rx::MultiDrawElementsInstancedBaseVertexBaseInstanceGeneral(
this, context, mode, counts, type, indices, instanceCounts, baseVertices, baseInstances,
drawcount);
......@@ -974,9 +942,4 @@ void ContextGL::flushIfNecessaryBeforeDeleteTextures()
mRenderer->flushIfNecessaryBeforeDeleteTextures();
}
void ContextGL::markWorkSubmitted()
{
mRenderer->markWorkSubmitted();
}
} // namespace rx
......@@ -269,8 +269,6 @@ class ContextGL : public ContextImpl
void setNeedsFlushBeforeDeleteTextures();
void flushIfNecessaryBeforeDeleteTextures();
void markWorkSubmitted();
private:
angle::Result setDrawArraysState(const gl::Context *context,
GLint first,
......
......@@ -39,8 +39,6 @@
#include "libANGLE/renderer/gl/renderergl_utils.h"
#include "libANGLE/renderer/renderer_utils.h"
#include <iostream>
namespace
{
......@@ -217,14 +215,8 @@ RendererGL::~RendererGL()
angle::Result RendererGL::flush()
{
if (!mWorkDoneSinceLastFlush && !mNeedsFlushBeforeDeleteTextures)
{
return angle::Result::Continue;
}
mFunctions->flush();
mNeedsFlushBeforeDeleteTextures = false;
mWorkDoneSinceLastFlush = false;
return angle::Result::Continue;
}
......@@ -237,7 +229,6 @@ angle::Result RendererGL::finish()
mFunctions->finish();
mNeedsFlushBeforeDeleteTextures = false;
mWorkDoneSinceLastFlush = false;
if (mFeatures.finishDoesNotCauseQueriesToBeAvailable.enabled && mUseDebugOutput)
{
......@@ -344,27 +335,23 @@ angle::Result RendererGL::dispatchCompute(const gl::Context *context,
GLuint numGroupsZ)
{
mFunctions->dispatchCompute(numGroupsX, numGroupsY, numGroupsZ);
mWorkDoneSinceLastFlush = true;
return angle::Result::Continue;
}
angle::Result RendererGL::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
{
mFunctions->dispatchComputeIndirect(indirect);
mWorkDoneSinceLastFlush = true;
return angle::Result::Continue;
}
angle::Result RendererGL::memoryBarrier(GLbitfield barriers)
{
mFunctions->memoryBarrier(barriers);
mWorkDoneSinceLastFlush = true;
return angle::Result::Continue;
}
angle::Result RendererGL::memoryBarrierByRegion(GLbitfield barriers)
{
mFunctions->memoryBarrierByRegion(barriers);
mWorkDoneSinceLastFlush = true;
return angle::Result::Continue;
}
......@@ -444,11 +431,6 @@ void RendererGL::setNeedsFlushBeforeDeleteTextures()
mNeedsFlushBeforeDeleteTextures = true;
}
void RendererGL::markWorkSubmitted()
{
mWorkDoneSinceLastFlush = true;
}
void RendererGL::flushIfNecessaryBeforeDeleteTextures()
{
if (mNeedsFlushBeforeDeleteTextures)
......
......@@ -135,8 +135,6 @@ class RendererGL : angle::NonCopyable
void setNeedsFlushBeforeDeleteTextures();
void flushIfNecessaryBeforeDeleteTextures();
void markWorkSubmitted();
void handleGPUSwitch();
protected:
......@@ -166,8 +164,6 @@ class RendererGL : angle::NonCopyable
mutable gl::Limitations mNativeLimitations;
mutable MultiviewImplementationTypeGL mMultiviewImplementationType;
bool mWorkDoneSinceLastFlush = false;
// The thread-to-context mapping for the currently active worker threads.
angle::HashMap<std::thread::id, std::unique_ptr<WorkerContext>> mCurrentWorkerContexts;
// The worker contexts available to use.
......
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