currentValueOffset can remain uninitialized

TRAC #12171 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Author: Andrew Lewycky git-svn-id: https://angleproject.googlecode.com/svn/trunk@239 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent f2f8d3c9
......@@ -26,7 +26,7 @@ namespace gl
{
VertexDataManager::VertexDataManager(Context *context, BufferBackEnd *backend)
: mContext(context), mBackend(backend), mDirtyCurrentValues(true)
: mContext(context), mBackend(backend), mDirtyCurrentValues(true), mCurrentValueOffset(0)
{
mStreamBuffer = mBackend->createVertexBuffer(INITIAL_STREAM_BUFFER_SIZE);
try
......@@ -224,7 +224,7 @@ void VertexDataManager::reloadCurrentValues(const AttributeState *attribs, std::
mCurrentValueBuffer->reserveSpace(totalSize);
float* p = static_cast<float*>(mCurrentValueBuffer->map(totalSize, offset));
float* p = static_cast<float*>(mCurrentValueBuffer->map(totalSize, &mCurrentValueOffset));
for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
{
......@@ -235,6 +235,8 @@ void VertexDataManager::reloadCurrentValues(const AttributeState *attribs, std::
mDirtyCurrentValues = false;
}
*offset = mCurrentValueOffset;
}
std::size_t VertexDataManager::typeSize(GLenum type) const
......
......@@ -99,11 +99,11 @@ class VertexDataManager
Context *mContext;
BufferBackEnd *mBackend;
TranslatedVertexBuffer *mCurrentValueBuffer;
TranslatedVertexBuffer *mStreamBuffer;
bool mDirtyCurrentValues;
std::size_t mCurrentValueOffset; // Offset within mCurrentValueBuffer that the current attribute values were last loaded at.
TranslatedVertexBuffer *mCurrentValueBuffer;
};
}
......
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