Commit 8fcd4e0c by Olli Etuaho

Fix redundant index validation on the D3D9 backend

Make sure that the computed index range is added to the cache of the main buffer object, instead of just to the static buffer object created for the buffer object. This applies to the code path used for D3D9. This way the front-end code in ValidateDrawElements gets the index range from the cache instead of having to iterate over all the indices used on every draw call. BUG=chromium:461274 TEST=WebGL conformance tests, angle_end2end_tests Change-Id: I07cf493d2771dab8e76d69bafda7ac49e5a04808 Reviewed-on: https://chromium-review.googlesource.com/262180Reviewed-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent 19a43dbe
...@@ -130,6 +130,10 @@ gl::Error IndexDataManager::prepareIndexData(GLenum type, GLsizei count, gl::Buf ...@@ -130,6 +130,10 @@ gl::Error IndexDataManager::prepareIndexData(GLenum type, GLsizei count, gl::Buf
streamOffset = (offset / typeInfo.bytes) * gl::GetTypeInfo(destinationIndexType).bytes; streamOffset = (offset / typeInfo.bytes) * gl::GetTypeInfo(destinationIndexType).bytes;
staticBuffer->getIndexRangeCache()->addRange(type, offset, count, translated->indexRange, streamOffset); staticBuffer->getIndexRangeCache()->addRange(type, offset, count, translated->indexRange, streamOffset);
} }
if (!buffer->getIndexRangeCache()->findRange(type, offset, count, nullptr, nullptr))
{
buffer->getIndexRangeCache()->addRange(type, offset, count, translated->indexRange, offset);
}
} }
// Avoid D3D11's primitive restart index value // Avoid D3D11's primitive restart index value
......
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