Call BufferStorage::markUsage when we retrieve a buffer pointer for rendering,…

Call BufferStorage::markUsage when we retrieve a buffer pointer for rendering, instead of when we prepare data. The automatic call eliminates function calls from other points in the library. TRAC #22852 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2288 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 675526eb
......@@ -33,8 +33,4 @@ void BufferStorage::updateSerial()
mSerial = mNextSerial++;
}
void BufferStorage::markBufferUsage()
{
}
}
......@@ -28,7 +28,6 @@ class BufferStorage
virtual void clear() = 0;
virtual unsigned int getSize() const = 0;
virtual bool supportsDirectBinding() const = 0;
virtual void markBufferUsage();
unsigned int getSerial() const;
protected:
......
......@@ -222,7 +222,7 @@ void BufferStorage11::markBufferUsage()
mReadUsageCount++;
mWriteUsageCount++;
static const unsigned int usageLimit = 5;
const unsigned int usageLimit = 5;
if (mReadUsageCount > usageLimit && mResolvedData)
{
......@@ -235,6 +235,8 @@ void BufferStorage11::markBufferUsage()
ID3D11Buffer *BufferStorage11::getBuffer(GLenum usage)
{
markBufferUsage();
for (DirectBufferList::iterator it = mDirectBuffers.begin(); it != mDirectBuffers.end(); it++)
{
DirectBufferStorage11 *directBuffer = *it;
......
......@@ -31,7 +31,6 @@ class BufferStorage11 : public BufferStorage
virtual void clear();
virtual unsigned int getSize() const;
virtual bool supportsDirectBinding() const;
virtual void markBufferUsage();
ID3D11Buffer *getBuffer(GLenum usage);
......@@ -51,6 +50,8 @@ class BufferStorage11 : public BufferStorage
unsigned int mReadUsageCount;
unsigned int mWriteUsageCount;
void markBufferUsage();
};
// Each instance of BufferStorageD3DBuffer11 is specialized for a class of D3D binding points
......
......@@ -162,7 +162,6 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, gl::Buffer
{
indexBuffer = streamingBuffer;
streamOffset = offset;
storage->markBufferUsage();
computeRange(type, indices, count, &translated->minIndex, &translated->maxIndex);
}
else if (staticBuffer && staticBuffer->getBufferSize() != 0 && staticBuffer->getIndexType() == type && alignedOffset)
......
......@@ -157,7 +157,6 @@ GLenum VertexDataManager::prepareVertexData(const gl::VertexAttribute attribs[],
{
outputElementSize = attribs[i].stride();
streamOffset = attribs[i].mOffset + outputElementSize * start;
storage->markBufferUsage();
}
else if (staticBuffer)
{
......
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