Commit bb7a1730 by Maxime Grégoire

Use a non-blocking lock for the streaming vertex buffer

Change-Id: I85f6306434f5810dd8357eeeedfb764bf2318668 Reviewed-on: https://swiftshader-review.googlesource.com/3411Tested-by: 's avatarMaxime Grégoire <mgregoire@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 9085c8db
...@@ -284,14 +284,9 @@ void *StreamingVertexBuffer::map(const VertexAttribute &attribute, unsigned int ...@@ -284,14 +284,9 @@ void *StreamingVertexBuffer::map(const VertexAttribute &attribute, unsigned int
if(mVertexBuffer) if(mVertexBuffer)
{ {
mapPtr = (char*)mVertexBuffer->lock(sw::PUBLIC) + mWritePosition; // We can use a private lock because we never overwrite the content
mapPtr = (char*)mVertexBuffer->lock(sw::PRIVATE) + mWritePosition;
if(!mapPtr)
{
ERR("Lock failed");
return NULL;
}
*offset = mWritePosition; *offset = mWritePosition;
mWritePosition += requiredSpace; mWritePosition += requiredSpace;
} }
......
...@@ -278,13 +278,8 @@ void *StreamingVertexBuffer::map(const VertexAttribute &attribute, unsigned int ...@@ -278,13 +278,8 @@ void *StreamingVertexBuffer::map(const VertexAttribute &attribute, unsigned int
if(mVertexBuffer) if(mVertexBuffer)
{ {
mapPtr = (char*)mVertexBuffer->lock(sw::PUBLIC) + mWritePosition; // We can use a private lock because we never overwrite the content
mapPtr = (char*)mVertexBuffer->lock(sw::PRIVATE) + mWritePosition;
if(!mapPtr)
{
ERR("Lock failed");
return NULL;
}
*offset = mWritePosition; *offset = mWritePosition;
mWritePosition += requiredSpace; mWritePosition += requiredSpace;
......
...@@ -291,13 +291,8 @@ void *StreamingVertexBuffer::map(const VertexAttribute &attribute, unsigned int ...@@ -291,13 +291,8 @@ void *StreamingVertexBuffer::map(const VertexAttribute &attribute, unsigned int
if(mVertexBuffer) if(mVertexBuffer)
{ {
mapPtr = (char*)mVertexBuffer->lock(sw::PUBLIC) + mWritePosition; // We can use a private lock because we never overwrite the content
mapPtr = (char*)mVertexBuffer->lock(sw::PRIVATE) + mWritePosition;
if(!mapPtr)
{
ERR("Lock failed");
return NULL;
}
*offset = mWritePosition; *offset = mWritePosition;
mWritePosition += requiredSpace; mWritePosition += requiredSpace;
......
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