Commit 8f1b0ee5 by Alexis Hetu Committed by Alexis Hétu

Fixed instanced rendering

Instanced rendering only requires a single attribute per instance, which was handled properly everywhere except in the streaming buffer, so that had to be fixed. All related dEQP tests pass. Change-Id: I9b9bd6cd790dfe7ecf7f5d2ed84623bfa4da4b6f Reviewed-on: https://swiftshader-review.googlesource.com/3430Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent dd8df68e
......@@ -128,7 +128,8 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
{
if(!attrib.mBoundBuffer)
{
mStreamingBuffer->addRequiredSpace(attrib.typeSize() * count);
const bool isInstanced = attrib.mDivisor > 0;
mStreamingBuffer->addRequiredSpace(attrib.typeSize() * (isInstanced ? 1 : count));
}
}
}
......@@ -168,7 +169,7 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
}
else
{
unsigned int streamOffset = writeAttributeData(mStreamingBuffer, firstVertexIndex, count, attrib);
unsigned int streamOffset = writeAttributeData(mStreamingBuffer, firstVertexIndex, isInstanced ? 1 : count, attrib);
if(streamOffset == -1)
{
......
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