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
break;
case DIRTY_OBJECT_VERTEX_ARRAY:
ASSERT(mVertexArray);
mVertexArray->syncState(context);
ANGLE_TRY(mVertexArray->syncState(context));
break;
case DIRTY_OBJECT_PROGRAM_TEXTURES:
syncProgramTextures(context);
......
......@@ -270,11 +270,12 @@ void VertexArray::setElementArrayBuffer(const Context *context, Buffer *buffer)
mDirtyBits.set(DIRTY_BIT_ELEMENT_ARRAY_BUFFER);
}
void VertexArray::syncState(const Context *context)
gl::Error VertexArray::syncState(const Context *context)
{
if (mDirtyBits.any())
{
mVertexArray->syncState(context, mDirtyBits, mDirtyAttribBits, mDirtyBindingBits);
ANGLE_TRY(
mVertexArray->syncState(context, mDirtyBits, mDirtyAttribBits, mDirtyBindingBits));
mDirtyBits.reset();
// This is a bit of an implementation hack - but since we know the implementation
......@@ -284,6 +285,7 @@ void VertexArray::syncState(const Context *context)
memset(&mDirtyAttribBits, 0, sizeof(mDirtyAttribBits));
memset(&mDirtyBindingBits, 0, sizeof(mDirtyBindingBits));
}
return gl::NoError();
}
void VertexArray::onBindingChanged(bool bound)
......
......@@ -204,7 +204,7 @@ class VertexArray final : public LabeledObject
static size_t GetVertexIndexFromDirtyBit(size_t dirtyBit);
void syncState(const Context *context);
gl::Error syncState(const Context *context);
bool hasAnyDirtyBit() const { return mDirtyBits.any(); }
ComponentTypeMask getAttributesTypeMask() const { return mState.mVertexAttributesTypeMask; }
......
......@@ -21,11 +21,12 @@ class VertexArrayImpl : angle::NonCopyable
{
public:
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::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
{
return gl::NoError();
}
virtual void destroy(const gl::Context *context) {}
......
......@@ -56,7 +56,7 @@ void VertexArray11::destroy(const gl::Context *context)
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::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
......@@ -86,6 +86,8 @@ void VertexArray11::syncState(const gl::Context *context,
mAttribsToUpdate.set(index);
}
}
return gl::NoError();
}
bool VertexArray11::flushAttribUpdates(const gl::Context *context)
......
......@@ -26,7 +26,7 @@ class VertexArray11 : public angle::ObserverInterface, public VertexArrayImpl
~VertexArray11() 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::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override;
......
......@@ -23,7 +23,7 @@ class VertexArray9 : public VertexArrayImpl
public:
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::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override;
......@@ -36,7 +36,7 @@ class VertexArray9 : public VertexArrayImpl
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::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
......@@ -44,6 +44,7 @@ inline void VertexArray9::syncState(const gl::Context *context,
ASSERT(dirtyBits.any());
Renderer9 *renderer = GetImplAs<Context9>(context)->getRenderer();
mCurrentStateSerial = renderer->generateSerial();
return gl::NoError();
}
} // namespace rx
......
......@@ -701,7 +701,7 @@ 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 gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
......@@ -734,6 +734,8 @@ void VertexArrayGL::syncState(const gl::Context *context,
}
}
}
return gl::NoError();
}
void VertexArrayGL::applyNumViewsToDivisor(int numViews)
......
......@@ -44,7 +44,7 @@ class VertexArrayGL : public VertexArrayImpl
GLuint getVertexArrayID() 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::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) override;
......
......@@ -93,7 +93,7 @@ gl::Error VertexArrayVk::streamVertexData(ContextVk *context,
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::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits)
......@@ -159,6 +159,8 @@ void VertexArrayVk::syncState(const gl::Context *context,
UNIMPLEMENTED();
}
}
return gl::NoError();
}
const gl::AttribArray<VkBuffer> &VertexArrayVk::getCurrentArrayBufferHandles() const
......
......@@ -31,7 +31,7 @@ class VertexArrayVk : public VertexArrayImpl
StreamingBuffer *stream,
size_t firstVertex,
size_t lastVertex);
void syncState(const gl::Context *context,
gl::Error syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits,
const gl::VertexArray::DirtyAttribBitsArray &attribBits,
const gl::VertexArray::DirtyBindingBitsArray &bindingBits) 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