Commit aa2f00af by Nicolas Capens

Early out when direct binding not supported.

BUG=angle:613 Change-Id: I488dca027e3f6d23cda546ca44af54dcc3338047 Reviewed-on: https://chromium-review.googlesource.com/197720Tested-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 69d8b7cf
...@@ -159,6 +159,12 @@ bool VertexBufferInterface::directStoragePossible(const gl::VertexAttribute &att ...@@ -159,6 +159,12 @@ bool VertexBufferInterface::directStoragePossible(const gl::VertexAttribute &att
{ {
gl::Buffer *buffer = attrib.mBoundBuffer.get(); gl::Buffer *buffer = attrib.mBoundBuffer.get();
BufferStorage *storage = buffer ? buffer->getStorage() : NULL; BufferStorage *storage = buffer ? buffer->getStorage() : NULL;
if (!storage || !storage->supportsDirectBinding())
{
return false;
}
gl::VertexFormat vertexFormat(attrib, currentValue.Type); gl::VertexFormat vertexFormat(attrib, currentValue.Type);
// Alignment restrictions: In D3D, vertex data must be aligned to // Alignment restrictions: In D3D, vertex data must be aligned to
...@@ -172,7 +178,7 @@ bool VertexBufferInterface::directStoragePossible(const gl::VertexAttribute &att ...@@ -172,7 +178,7 @@ bool VertexBufferInterface::directStoragePossible(const gl::VertexAttribute &att
(static_cast<size_t>(attrib.mOffset) % alignment == 0); (static_cast<size_t>(attrib.mOffset) % alignment == 0);
bool requiresConversion = (mRenderer->getVertexConversionType(vertexFormat) & VERTEX_CONVERT_CPU) > 0; bool requiresConversion = (mRenderer->getVertexConversionType(vertexFormat) & VERTEX_CONVERT_CPU) > 0;
return storage && storage->supportsDirectBinding() && !requiresConversion && isAligned; return !requiresConversion && isAligned;
} }
StreamingVertexBufferInterface::StreamingVertexBufferInterface(rx::Renderer *renderer, std::size_t initialSize) : VertexBufferInterface(renderer, true) StreamingVertexBufferInterface::StreamingVertexBufferInterface(rx::Renderer *renderer, std::size_t initialSize) : VertexBufferInterface(renderer, true)
......
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