Commit 1119ce64 by Alexis Hetu Committed by Alexis Hétu

Fixed buffer offset when primitive restart is enabled

The data pointer 'buffer->data()' was being used without the offset applied, which means we were using the wrong part of the index buffer when primitive restart is enabled. 'indices' should already contain the properly offset buffer pointer, so using it directly should work. Bug chromium:823096 Change-Id: If70634f63d40d8efde9b1336370c1a63b1faa19f Reviewed-on: https://swiftshader-review.googlesource.com/18268Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 1eca243a
...@@ -318,7 +318,7 @@ GLenum IndexDataManager::prepareIndexData(GLenum mode, GLenum type, GLuint start ...@@ -318,7 +318,7 @@ GLenum IndexDataManager::prepareIndexData(GLenum mode, GLenum type, GLuint start
return GL_OUT_OF_MEMORY; return GL_OUT_OF_MEMORY;
} }
copyIndices(mode, type, *restartIndices, staticBuffer ? buffer->data() : indices, count, output); copyIndices(mode, type, *restartIndices, indices, count, output);
streamingBuffer->unmap(); streamingBuffer->unmap();
translated->indexBuffer = streamingBuffer->getResource(); translated->indexBuffer = streamingBuffer->getResource();
......
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