Commit 0af5b86a by Frank Henigman Committed by Commit Bot

Return gl::Error from VertexArray::syncState().

No functional change. When we add vertex data format conversion to Vulkan we will need to be able to return an error from VertexArray::syncState(). BUG=angleproject:2405 Change-Id: I4b537946ecbb6593280b6510c5cd8d8e3c65e8dd Reviewed-on: https://chromium-review.googlesource.com/982897 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org>
parent 3b678745
...@@ -2501,7 +2501,7 @@ Error State::syncDirtyObjects(const Context *context, const DirtyObjects &bitset ...@@ -2501,7 +2501,7 @@ Error State::syncDirtyObjects(const Context *context, const DirtyObjects &bitset
break; break;
case DIRTY_OBJECT_VERTEX_ARRAY: case DIRTY_OBJECT_VERTEX_ARRAY:
ASSERT(mVertexArray); ASSERT(mVertexArray);
mVertexArray->syncState(context); ANGLE_TRY(mVertexArray->syncState(context));
break; break;
case DIRTY_OBJECT_PROGRAM_TEXTURES: case DIRTY_OBJECT_PROGRAM_TEXTURES:
syncProgramTextures(context); syncProgramTextures(context);
......
...@@ -270,11 +270,12 @@ void VertexArray::setElementArrayBuffer(const Context *context, Buffer *buffer) ...@@ -270,11 +270,12 @@ void VertexArray::setElementArrayBuffer(const Context *context, Buffer *buffer)
mDirtyBits.set(DIRTY_BIT_ELEMENT_ARRAY_BUFFER); mDirtyBits.set(DIRTY_BIT_ELEMENT_ARRAY_BUFFER);
} }
void VertexArray::syncState(const Context *context) gl::Error VertexArray::syncState(const Context *context)
{ {
if (mDirtyBits.any()) if (mDirtyBits.any())
{ {
mVertexArray->syncState(context, mDirtyBits, mDirtyAttribBits, mDirtyBindingBits); ANGLE_TRY(
mVertexArray->syncState(context, mDirtyBits, mDirtyAttribBits, mDirtyBindingBits));
mDirtyBits.reset(); mDirtyBits.reset();
// This is a bit of an implementation hack - but since we know the implementation // This is a bit of an implementation hack - but since we know the implementation
...@@ -284,6 +285,7 @@ void VertexArray::syncState(const Context *context) ...@@ -284,6 +285,7 @@ void VertexArray::syncState(const Context *context)
memset(&mDirtyAttribBits, 0, sizeof(mDirtyAttribBits)); memset(&mDirtyAttribBits, 0, sizeof(mDirtyAttribBits));
memset(&mDirtyBindingBits, 0, sizeof(mDirtyBindingBits)); memset(&mDirtyBindingBits, 0, sizeof(mDirtyBindingBits));
} }
return gl::NoError();
} }
void VertexArray::onBindingChanged(bool bound) void VertexArray::onBindingChanged(bool bound)
......
...@@ -204,7 +204,7 @@ class VertexArray final : public LabeledObject ...@@ -204,7 +204,7 @@ class VertexArray final : public LabeledObject
static size_t GetVertexIndexFromDirtyBit(size_t dirtyBit); static size_t GetVertexIndexFromDirtyBit(size_t dirtyBit);
void syncState(const Context *context); gl::Error syncState(const Context *context);
bool hasAnyDirtyBit() const { return mDirtyBits.any(); } bool hasAnyDirtyBit() const { return mDirtyBits.any(); }
ComponentTypeMask getAttributesTypeMask() const { return mState.mVertexAttributesTypeMask; } ComponentTypeMask getAttributesTypeMask() const { return mState.mVertexAttributesTypeMask; }
......
...@@ -21,11 +21,12 @@ class VertexArrayImpl : angle::NonCopyable ...@@ -21,11 +21,12 @@ class VertexArrayImpl : angle::NonCopyable
{ {
public: public:
VertexArrayImpl(const gl::VertexArrayState &state) : mState(state) {} VertexArrayImpl(const gl::VertexArrayState &state) : mState(state) {}
virtual void syncState(const gl::Context *context, virtual gl::Error syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
{ {
return gl::NoError();
} }
virtual void destroy(const gl::Context *context) {} virtual void destroy(const gl::Context *context) {}
......
...@@ -56,10 +56,10 @@ void VertexArray11::destroy(const gl::Context *context) ...@@ -56,10 +56,10 @@ void VertexArray11::destroy(const gl::Context *context)
mCurrentElementArrayBuffer.set(context, nullptr); mCurrentElementArrayBuffer.set(context, nullptr);
} }
void VertexArray11::syncState(const gl::Context *context, gl::Error VertexArray11::syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
{ {
ASSERT(dirtyBits.any()); ASSERT(dirtyBits.any());
...@@ -86,6 +86,8 @@ void VertexArray11::syncState(const gl::Context *context, ...@@ -86,6 +86,8 @@ void VertexArray11::syncState(const gl::Context *context,
mAttribsToUpdate.set(index); mAttribsToUpdate.set(index);
} }
} }
return gl::NoError();
} }
bool VertexArray11::flushAttribUpdates(const gl::Context *context) bool VertexArray11::flushAttribUpdates(const gl::Context *context)
......
...@@ -26,10 +26,10 @@ class VertexArray11 : public angle::ObserverInterface, public VertexArrayImpl ...@@ -26,10 +26,10 @@ class VertexArray11 : public angle::ObserverInterface, public VertexArrayImpl
~VertexArray11() override; ~VertexArray11() override;
void destroy(const gl::Context *context) override; void destroy(const gl::Context *context) override;
void syncState(const gl::Context *context, gl::Error syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override; const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override;
// This will flush any pending attrib updates and then check the dynamic attribs mask. // This will flush any pending attrib updates and then check the dynamic attribs mask.
bool hasActiveDynamicAttrib(const gl::Context *context); bool hasActiveDynamicAttrib(const gl::Context *context);
gl::Error updateDirtyAndDynamicAttribs(const gl::Context *context, gl::Error updateDirtyAndDynamicAttribs(const gl::Context *context,
......
...@@ -23,10 +23,10 @@ class VertexArray9 : public VertexArrayImpl ...@@ -23,10 +23,10 @@ class VertexArray9 : public VertexArrayImpl
public: public:
VertexArray9(const gl::VertexArrayState &data) : VertexArrayImpl(data) {} VertexArray9(const gl::VertexArrayState &data) : VertexArrayImpl(data) {}
void syncState(const gl::Context *context, gl::Error syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override; const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override;
~VertexArray9() override {} ~VertexArray9() override {}
...@@ -36,14 +36,15 @@ class VertexArray9 : public VertexArrayImpl ...@@ -36,14 +36,15 @@ class VertexArray9 : public VertexArrayImpl
Serial mCurrentStateSerial; Serial mCurrentStateSerial;
}; };
inline void VertexArray9::syncState(const gl::Context *context, inline gl::Error VertexArray9::syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
{ {
ASSERT(dirtyBits.any()); ASSERT(dirtyBits.any());
Renderer9 *renderer = GetImplAs<Context9>(context)->getRenderer(); Renderer9 *renderer = GetImplAs<Context9>(context)->getRenderer();
mCurrentStateSerial = renderer->generateSerial(); mCurrentStateSerial = renderer->generateSerial();
return gl::NoError();
} }
} // namespace rx } // namespace rx
......
...@@ -701,10 +701,10 @@ void VertexArrayGL::syncDirtyBinding(const gl::Context *context, ...@@ -701,10 +701,10 @@ void VertexArrayGL::syncDirtyBinding(const gl::Context *context,
} }
} }
void VertexArrayGL::syncState(const gl::Context *context, gl::Error VertexArrayGL::syncState(const gl::Context *context,
const VertexArray::DirtyBits &dirtyBits, const VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
{ {
mStateManager->bindVertexArray(mVertexArrayID, getAppliedElementArrayBufferID()); mStateManager->bindVertexArray(mVertexArrayID, getAppliedElementArrayBufferID());
...@@ -734,6 +734,8 @@ void VertexArrayGL::syncState(const gl::Context *context, ...@@ -734,6 +734,8 @@ void VertexArrayGL::syncState(const gl::Context *context,
} }
} }
} }
return gl::NoError();
} }
void VertexArrayGL::applyNumViewsToDivisor(int numViews) void VertexArrayGL::applyNumViewsToDivisor(int numViews)
......
...@@ -44,10 +44,10 @@ class VertexArrayGL : public VertexArrayImpl ...@@ -44,10 +44,10 @@ class VertexArrayGL : public VertexArrayImpl
GLuint getVertexArrayID() const; GLuint getVertexArrayID() const;
GLuint getAppliedElementArrayBufferID() const; GLuint getAppliedElementArrayBufferID() const;
void syncState(const gl::Context *context, gl::Error syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override; const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override;
void applyNumViewsToDivisor(int numViews); void applyNumViewsToDivisor(int numViews);
......
...@@ -93,10 +93,10 @@ gl::Error VertexArrayVk::streamVertexData(ContextVk *context, ...@@ -93,10 +93,10 @@ gl::Error VertexArrayVk::streamVertexData(ContextVk *context,
return gl::NoError(); return gl::NoError();
} }
void VertexArrayVk::syncState(const gl::Context *context, gl::Error VertexArrayVk::syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
{ {
ASSERT(dirtyBits.any()); ASSERT(dirtyBits.any());
...@@ -159,6 +159,8 @@ void VertexArrayVk::syncState(const gl::Context *context, ...@@ -159,6 +159,8 @@ void VertexArrayVk::syncState(const gl::Context *context,
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
} }
return gl::NoError();
} }
const gl::AttribArray<VkBuffer> &VertexArrayVk::getCurrentArrayBufferHandles() const const gl::AttribArray<VkBuffer> &VertexArrayVk::getCurrentArrayBufferHandles() const
......
...@@ -31,10 +31,10 @@ class VertexArrayVk : public VertexArrayImpl ...@@ -31,10 +31,10 @@ class VertexArrayVk : public VertexArrayImpl
StreamingBuffer *stream, StreamingBuffer *stream,
size_t firstVertex, size_t firstVertex,
size_t lastVertex); size_t lastVertex);
void syncState(const gl::Context *context, gl::Error syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits, const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits, const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override; const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override;
const gl::AttribArray<VkBuffer> &getCurrentArrayBufferHandles() const; const gl::AttribArray<VkBuffer> &getCurrentArrayBufferHandles() const;
const gl::AttribArray<VkDeviceSize> &getCurrentArrayBufferOffsets() const; const gl::AttribArray<VkDeviceSize> &getCurrentArrayBufferOffsets() const;
......
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