Commit 189ad877 by Jamie Madill Committed by Commit Bot

Return an Error from ContextImpl::syncState.

This will allow the Vulkan back-end to call Vulkan commands that return VkResult within syncState. Bug: angleproject:2717 Change-Id: I05e1379e71acaac56bcc9493c8561e82da000934 Reviewed-on: https://chromium-review.googlesource.com/1120150 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org>
parent d7890bca
...@@ -3438,7 +3438,7 @@ Error Context::syncState(const State::DirtyBits &bitMask, const State::DirtyObje ...@@ -3438,7 +3438,7 @@ Error Context::syncState(const State::DirtyBits &bitMask, const State::DirtyObje
Error Context::syncDirtyBits() Error Context::syncDirtyBits()
{ {
const State::DirtyBits &dirtyBits = mGLState.getDirtyBits(); const State::DirtyBits &dirtyBits = mGLState.getDirtyBits();
mImplementation->syncState(this, dirtyBits); ANGLE_TRY(mImplementation->syncState(this, dirtyBits));
mGLState.clearDirtyBits(); mGLState.clearDirtyBits();
return NoError(); return NoError();
} }
...@@ -3446,7 +3446,7 @@ Error Context::syncDirtyBits() ...@@ -3446,7 +3446,7 @@ Error Context::syncDirtyBits()
Error Context::syncDirtyBits(const State::DirtyBits &bitMask) Error Context::syncDirtyBits(const State::DirtyBits &bitMask)
{ {
const State::DirtyBits &dirtyBits = (mGLState.getDirtyBits() & bitMask); const State::DirtyBits &dirtyBits = (mGLState.getDirtyBits() & bitMask);
mImplementation->syncState(this, dirtyBits); ANGLE_TRY(mImplementation->syncState(this, dirtyBits));
mGLState.clearDirtyBits(dirtyBits); mGLState.clearDirtyBits(dirtyBits);
return NoError(); return NoError();
} }
......
...@@ -140,7 +140,8 @@ class ContextImpl : public GLImplFactory ...@@ -140,7 +140,8 @@ class ContextImpl : public GLImplFactory
virtual void popDebugGroup() = 0; virtual void popDebugGroup() = 0;
// State sync with dirty bits. // State sync with dirty bits.
virtual void syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) = 0; virtual gl::Error syncState(const gl::Context *context,
const gl::State::DirtyBits &dirtyBits) = 0;
// Disjoint timer queries // Disjoint timer queries
virtual GLint getGPUDisjoint() = 0; virtual GLint getGPUDisjoint() = 0;
......
...@@ -403,9 +403,10 @@ void Context11::popDebugGroup() ...@@ -403,9 +403,10 @@ void Context11::popDebugGroup()
popGroupMarker(); popGroupMarker();
} }
void Context11::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) gl::Error Context11::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits)
{ {
mRenderer->getStateManager()->syncState(context, dirtyBits); mRenderer->getStateManager()->syncState(context, dirtyBits);
return gl::NoError();
} }
GLint Context11::getGPUDisjoint() GLint Context11::getGPUDisjoint()
......
...@@ -120,7 +120,7 @@ class Context11 : public ContextImpl ...@@ -120,7 +120,7 @@ class Context11 : public ContextImpl
void popDebugGroup() override; void popDebugGroup() override;
// State sync with dirty bits. // State sync with dirty bits.
void syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override; gl::Error syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override;
// Disjoint timer queries // Disjoint timer queries
GLint getGPUDisjoint() override; GLint getGPUDisjoint() override;
......
...@@ -255,9 +255,10 @@ void Context9::popDebugGroup() ...@@ -255,9 +255,10 @@ void Context9::popDebugGroup()
popGroupMarker(); popGroupMarker();
} }
void Context9::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) gl::Error Context9::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits)
{ {
mRenderer->getStateManager()->syncState(mState.getState(), dirtyBits); mRenderer->getStateManager()->syncState(mState.getState(), dirtyBits);
return gl::NoError();
} }
GLint Context9::getGPUDisjoint() GLint Context9::getGPUDisjoint()
......
...@@ -120,7 +120,7 @@ class Context9 : public ContextImpl ...@@ -120,7 +120,7 @@ class Context9 : public ContextImpl
void popDebugGroup() override; void popDebugGroup() override;
// State sync with dirty bits. // State sync with dirty bits.
void syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override; gl::Error syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override;
// Disjoint timer queries // Disjoint timer queries
GLint getGPUDisjoint() override; GLint getGPUDisjoint() override;
......
...@@ -365,9 +365,10 @@ void ContextGL::popDebugGroup() ...@@ -365,9 +365,10 @@ void ContextGL::popDebugGroup()
mRenderer->popDebugGroup(); mRenderer->popDebugGroup();
} }
void ContextGL::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) gl::Error ContextGL::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits)
{ {
mRenderer->getStateManager()->syncState(context, dirtyBits); mRenderer->getStateManager()->syncState(context, dirtyBits);
return gl::NoError();
} }
GLint ContextGL::getGPUDisjoint() GLint ContextGL::getGPUDisjoint()
......
...@@ -174,7 +174,7 @@ class ContextGL : public ContextImpl ...@@ -174,7 +174,7 @@ class ContextGL : public ContextImpl
void popDebugGroup() override; void popDebugGroup() override;
// State sync with dirty bits. // State sync with dirty bits.
void syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override; gl::Error syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override;
// Disjoint timer queries // Disjoint timer queries
GLint getGPUDisjoint() override; GLint getGPUDisjoint() override;
......
...@@ -295,8 +295,9 @@ void ContextNULL::popDebugGroup() ...@@ -295,8 +295,9 @@ void ContextNULL::popDebugGroup()
{ {
} }
void ContextNULL::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) gl::Error ContextNULL::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits)
{ {
return gl::NoError();
} }
GLint ContextNULL::getGPUDisjoint() GLint ContextNULL::getGPUDisjoint()
......
...@@ -142,7 +142,7 @@ class ContextNULL : public ContextImpl ...@@ -142,7 +142,7 @@ class ContextNULL : public ContextImpl
void popDebugGroup() override; void popDebugGroup() override;
// State sync with dirty bits. // State sync with dirty bits.
void syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override; gl::Error syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override;
// Disjoint timer queries // Disjoint timer queries
GLint getGPUDisjoint() override; GLint getGPUDisjoint() override;
......
...@@ -414,7 +414,7 @@ void ContextVk::updateScissor(const gl::State &glState) ...@@ -414,7 +414,7 @@ void ContextVk::updateScissor(const gl::State &glState)
} }
} }
void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) gl::Error ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits)
{ {
if (dirtyBits.any()) if (dirtyBits.any())
{ {
...@@ -655,6 +655,8 @@ void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits ...@@ -655,6 +655,8 @@ void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits
programVk->invalidateTextures(); programVk->invalidateTextures();
mTexturesDirty = true; mTexturesDirty = true;
} }
return gl::NoError();
} }
GLint ContextVk::getGPUDisjoint() GLint ContextVk::getGPUDisjoint()
......
...@@ -90,7 +90,7 @@ class ContextVk : public ContextImpl ...@@ -90,7 +90,7 @@ class ContextVk : public ContextImpl
bool isViewportFlipEnabled(); bool isViewportFlipEnabled();
// State sync with dirty bits. // State sync with dirty bits.
void syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override; gl::Error syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits) override;
// Disjoint timer queries // Disjoint timer queries
GLint getGPUDisjoint() override; GLint getGPUDisjoint() override;
......
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