Commit 492f58ec by Jamie Madill Committed by Commit Bot

Rename VertexArrayImpl::mData to mState.

Refactoring change only. BUG=angleproject:1898 Change-Id: I9f55651f923ff930c395a9bb575b4f86ad5d9cbd Reviewed-on: https://chromium-review.googlesource.com/707689Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent af5070f7
...@@ -20,7 +20,7 @@ class ContextImpl; ...@@ -20,7 +20,7 @@ class ContextImpl;
class VertexArrayImpl : angle::NonCopyable class VertexArrayImpl : angle::NonCopyable
{ {
public: public:
VertexArrayImpl(const gl::VertexArrayState &data) : mData(data) {} VertexArrayImpl(const gl::VertexArrayState &state) : mState(state) {}
virtual void syncState(const gl::Context *context, const gl::VertexArray::DirtyBits &dirtyBits) virtual void syncState(const gl::Context *context, const gl::VertexArray::DirtyBits &dirtyBits)
{ {
} }
...@@ -29,7 +29,7 @@ class VertexArrayImpl : angle::NonCopyable ...@@ -29,7 +29,7 @@ class VertexArrayImpl : angle::NonCopyable
virtual ~VertexArrayImpl() {} virtual ~VertexArrayImpl() {}
protected: protected:
const gl::VertexArrayState &mData; const gl::VertexArrayState &mState;
}; };
} }
......
...@@ -63,7 +63,7 @@ void VertexArray11::syncState(const gl::Context *context, ...@@ -63,7 +63,7 @@ void VertexArray11::syncState(const gl::Context *context,
size_t index = gl::VertexArray::GetVertexIndexFromDirtyBit(dirtyBit); size_t index = gl::VertexArray::GetVertexIndexFromDirtyBit(dirtyBit);
// TODO(jiawei.shao@intel.com): Vertex Attrib Bindings // TODO(jiawei.shao@intel.com): Vertex Attrib Bindings
ASSERT(index == mData.getBindingIndexFromAttribIndex(index)); ASSERT(index == mState.getBindingIndexFromAttribIndex(index));
mAttribsToUpdate.set(index); mAttribsToUpdate.set(index);
} }
} }
...@@ -92,8 +92,8 @@ bool VertexArray11::flushAttribUpdates(const gl::Context *context) ...@@ -92,8 +92,8 @@ bool VertexArray11::flushAttribUpdates(const gl::Context *context)
void VertexArray11::updateVertexAttribStorage(const gl::Context *context, size_t attribIndex) void VertexArray11::updateVertexAttribStorage(const gl::Context *context, size_t attribIndex)
{ {
const auto &attrib = mData.getVertexAttribute(attribIndex); const auto &attrib = mState.getVertexAttribute(attribIndex);
const auto &binding = mData.getBindingFromAttribIndex(attribIndex); const auto &binding = mState.getBindingFromAttribIndex(attribIndex);
// Note: having an unchanged storage type doesn't mean the attribute is clean. // Note: having an unchanged storage type doesn't mean the attribute is clean.
auto oldStorageType = mAttributeStorageTypes[attribIndex]; auto oldStorageType = mAttributeStorageTypes[attribIndex];
...@@ -181,8 +181,8 @@ gl::Error VertexArray11::updateDirtyAndDynamicAttribs(const gl::Context *context ...@@ -181,8 +181,8 @@ gl::Error VertexArray11::updateDirtyAndDynamicAttribs(const gl::Context *context
const auto &glState = context->getGLState(); const auto &glState = context->getGLState();
const gl::Program *program = glState.getProgram(); const gl::Program *program = glState.getProgram();
const auto &activeLocations = program->getActiveAttribLocationsMask(); const auto &activeLocations = program->getActiveAttribLocationsMask();
const auto &attribs = mData.getVertexAttributes(); const auto &attribs = mState.getVertexAttributes();
const auto &bindings = mData.getVertexBindings(); const auto &bindings = mState.getVertexBindings();
mAppliedNumViewsToDivisor = mAppliedNumViewsToDivisor =
(program != nullptr && program->usesMultiview()) ? program->getNumViews() : 1; (program != nullptr && program->usesMultiview()) ? program->getNumViews() : 1;
......
...@@ -129,7 +129,7 @@ gl::Error VertexArrayGL::syncDrawElementsState(const gl::Context *context, ...@@ -129,7 +129,7 @@ gl::Error VertexArrayGL::syncDrawElementsState(const gl::Context *context,
gl::Error VertexArrayGL::syncElementArrayState(const gl::Context *context) const gl::Error VertexArrayGL::syncElementArrayState(const gl::Context *context) const
{ {
gl::Buffer *elementArrayBuffer = mData.getElementArrayBuffer().get(); gl::Buffer *elementArrayBuffer = mState.getElementArrayBuffer().get();
ASSERT(elementArrayBuffer); ASSERT(elementArrayBuffer);
if (elementArrayBuffer != mAppliedElementArrayBuffer.get()) if (elementArrayBuffer != mAppliedElementArrayBuffer.get())
{ {
...@@ -191,7 +191,7 @@ gl::Error VertexArrayGL::syncIndexData(const gl::Context *context, ...@@ -191,7 +191,7 @@ gl::Error VertexArrayGL::syncIndexData(const gl::Context *context,
{ {
ASSERT(outIndices); ASSERT(outIndices);
gl::Buffer *elementArrayBuffer = mData.getElementArrayBuffer().get(); gl::Buffer *elementArrayBuffer = mState.getElementArrayBuffer().get();
// Need to check the range of indices if attributes need to be streamed // Need to check the range of indices if attributes need to be streamed
if (elementArrayBuffer != nullptr) if (elementArrayBuffer != nullptr)
...@@ -207,7 +207,7 @@ gl::Error VertexArrayGL::syncIndexData(const gl::Context *context, ...@@ -207,7 +207,7 @@ gl::Error VertexArrayGL::syncIndexData(const gl::Context *context,
if (attributesNeedStreaming) if (attributesNeedStreaming)
{ {
ptrdiff_t elementArrayBufferOffset = reinterpret_cast<ptrdiff_t>(indices); ptrdiff_t elementArrayBufferOffset = reinterpret_cast<ptrdiff_t>(indices);
Error error = mData.getElementArrayBuffer()->getIndexRange( Error error = mState.getElementArrayBuffer()->getIndexRange(
context, type, elementArrayBufferOffset, count, primitiveRestartEnabled, context, type, elementArrayBufferOffset, count, primitiveRestartEnabled,
outIndexRange); outIndexRange);
if (error.isError()) if (error.isError())
...@@ -277,8 +277,8 @@ void VertexArrayGL::computeStreamingAttributeSizes(const gl::AttributesMask &act ...@@ -277,8 +277,8 @@ void VertexArrayGL::computeStreamingAttributeSizes(const gl::AttributesMask &act
ASSERT(mAttributesNeedStreaming.any()); ASSERT(mAttributesNeedStreaming.any());
const auto &attribs = mData.getVertexAttributes(); const auto &attribs = mState.getVertexAttributes();
const auto &bindings = mData.getVertexBindings(); const auto &bindings = mState.getVertexBindings();
gl::AttributesMask attribsToStream = (mAttributesNeedStreaming & activeAttributesMask); gl::AttributesMask attribsToStream = (mAttributesNeedStreaming & activeAttributesMask);
...@@ -345,8 +345,8 @@ gl::Error VertexArrayGL::streamAttributes(const gl::AttributesMask &activeAttrib ...@@ -345,8 +345,8 @@ gl::Error VertexArrayGL::streamAttributes(const gl::AttributesMask &activeAttrib
requiredBufferSize, GL_MAP_WRITE_BIT); requiredBufferSize, GL_MAP_WRITE_BIT);
size_t curBufferOffset = bufferEmptySpace; size_t curBufferOffset = bufferEmptySpace;
const auto &attribs = mData.getVertexAttributes(); const auto &attribs = mState.getVertexAttributes();
const auto &bindings = mData.getVertexBindings(); const auto &bindings = mState.getVertexBindings();
gl::AttributesMask attribsToStream = (mAttributesNeedStreaming & activeAttributesMask); gl::AttributesMask attribsToStream = (mAttributesNeedStreaming & activeAttributesMask);
...@@ -430,14 +430,14 @@ GLuint VertexArrayGL::getAppliedElementArrayBufferID() const ...@@ -430,14 +430,14 @@ GLuint VertexArrayGL::getAppliedElementArrayBufferID() const
void VertexArrayGL::updateNeedsStreaming(size_t attribIndex) void VertexArrayGL::updateNeedsStreaming(size_t attribIndex)
{ {
const auto &attrib = mData.getVertexAttribute(attribIndex); const auto &attrib = mState.getVertexAttribute(attribIndex);
const auto &binding = mData.getBindingFromAttribIndex(attribIndex); const auto &binding = mState.getBindingFromAttribIndex(attribIndex);
mAttributesNeedStreaming.set(attribIndex, AttributeNeedsStreaming(attrib, binding)); mAttributesNeedStreaming.set(attribIndex, AttributeNeedsStreaming(attrib, binding));
} }
void VertexArrayGL::updateAttribEnabled(size_t attribIndex) void VertexArrayGL::updateAttribEnabled(size_t attribIndex)
{ {
const bool enabled = mData.getVertexAttribute(attribIndex).enabled; const bool enabled = mState.getVertexAttribute(attribIndex).enabled;
if (mAppliedAttributes[attribIndex].enabled == enabled) if (mAppliedAttributes[attribIndex].enabled == enabled)
{ {
return; return;
...@@ -459,11 +459,11 @@ void VertexArrayGL::updateAttribEnabled(size_t attribIndex) ...@@ -459,11 +459,11 @@ void VertexArrayGL::updateAttribEnabled(size_t attribIndex)
void VertexArrayGL::updateAttribPointer(const gl::Context *context, size_t attribIndex) void VertexArrayGL::updateAttribPointer(const gl::Context *context, size_t attribIndex)
{ {
const VertexAttribute &attrib = mData.getVertexAttribute(attribIndex); const VertexAttribute &attrib = mState.getVertexAttribute(attribIndex);
// According to SPEC, VertexAttribPointer should update the binding indexed attribIndex instead // According to SPEC, VertexAttribPointer should update the binding indexed attribIndex instead
// of the binding indexed attrib.bindingIndex (unless attribIndex == attrib.bindingIndex). // of the binding indexed attrib.bindingIndex (unless attribIndex == attrib.bindingIndex).
const VertexBinding &binding = mData.getVertexBinding(attribIndex); const VertexBinding &binding = mState.getVertexBinding(attribIndex);
// Since mAttributesNeedStreaming[attribIndex] keeps the value set in the last draw, here we // Since mAttributesNeedStreaming[attribIndex] keeps the value set in the last draw, here we
// only need to update it when the buffer has been changed. e.g. When we set an attribute to be // only need to update it when the buffer has been changed. e.g. When we set an attribute to be
...@@ -555,7 +555,7 @@ void VertexArrayGL::updateAttribFormat(size_t attribIndex) ...@@ -555,7 +555,7 @@ void VertexArrayGL::updateAttribFormat(size_t attribIndex)
{ {
ASSERT(supportVertexAttribBinding()); ASSERT(supportVertexAttribBinding());
const VertexAttribute &attrib = mData.getVertexAttribute(attribIndex); const VertexAttribute &attrib = mState.getVertexAttribute(attribIndex);
if (SameVertexAttribFormat(mAppliedAttributes[attribIndex], attrib)) if (SameVertexAttribFormat(mAppliedAttributes[attribIndex], attrib))
{ {
return; return;
...@@ -584,7 +584,7 @@ void VertexArrayGL::updateAttribBinding(size_t attribIndex) ...@@ -584,7 +584,7 @@ void VertexArrayGL::updateAttribBinding(size_t attribIndex)
{ {
ASSERT(supportVertexAttribBinding()); ASSERT(supportVertexAttribBinding());
GLuint bindingIndex = mData.getVertexAttribute(attribIndex).bindingIndex; GLuint bindingIndex = mState.getVertexAttribute(attribIndex).bindingIndex;
if (mAppliedAttributes[attribIndex].bindingIndex == bindingIndex) if (mAppliedAttributes[attribIndex].bindingIndex == bindingIndex)
{ {
return; return;
...@@ -599,7 +599,7 @@ void VertexArrayGL::updateBindingBuffer(const gl::Context *context, size_t bindi ...@@ -599,7 +599,7 @@ void VertexArrayGL::updateBindingBuffer(const gl::Context *context, size_t bindi
{ {
ASSERT(supportVertexAttribBinding()); ASSERT(supportVertexAttribBinding());
const VertexBinding &binding = mData.getVertexBinding(bindingIndex); const VertexBinding &binding = mState.getVertexBinding(bindingIndex);
if (SameVertexBuffer(mAppliedBindings[bindingIndex], binding)) if (SameVertexBuffer(mAppliedBindings[bindingIndex], binding))
{ {
return; return;
...@@ -623,7 +623,7 @@ void VertexArrayGL::updateBindingBuffer(const gl::Context *context, size_t bindi ...@@ -623,7 +623,7 @@ void VertexArrayGL::updateBindingBuffer(const gl::Context *context, size_t bindi
void VertexArrayGL::updateBindingDivisor(size_t bindingIndex) void VertexArrayGL::updateBindingDivisor(size_t bindingIndex)
{ {
GLuint adjustedDivisor = GLuint adjustedDivisor =
GetAdjustedDivisor(mAppliedNumViews, mData.getVertexBinding(bindingIndex).getDivisor()); GetAdjustedDivisor(mAppliedNumViews, mState.getVertexBinding(bindingIndex).getDivisor());
if (mAppliedBindings[bindingIndex].getDivisor() == adjustedDivisor) if (mAppliedBindings[bindingIndex].getDivisor() == adjustedDivisor)
{ {
return; return;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
namespace rx namespace rx
{ {
VertexArrayVk::VertexArrayVk(const gl::VertexArrayState &data) : VertexArrayImpl(data) VertexArrayVk::VertexArrayVk(const gl::VertexArrayState &state) : VertexArrayImpl(state)
{ {
} }
......
...@@ -18,7 +18,7 @@ namespace rx ...@@ -18,7 +18,7 @@ namespace rx
class VertexArrayVk : public VertexArrayImpl class VertexArrayVk : public VertexArrayImpl
{ {
public: public:
VertexArrayVk(const gl::VertexArrayState &data); VertexArrayVk(const gl::VertexArrayState &state);
void destroy(const gl::Context *context) override; void destroy(const gl::Context *context) override;
void syncState(const gl::Context *context, void syncState(const gl::Context *context,
......
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