Commit 9d84ccba by Frank Henigman Committed by Commit Bot

Vulkan: renderer->finish() before reading buffers.

Have to call renderer->finish() before reading a buffer otherwise you can get stale data. Enable IndexBufferOffsetTest.UInt8Index/ES2_VULKAN which now works. Disable LineLoopTest.LineLoopUShortIndexBuffer/ES2_VULKAN which stopped working on Windows with Intel GPU. BUG=angleproject:2659 Change-Id: I1e21b0e1dacd3368923caf18e767e34ab696eef6 Reviewed-on: https://chromium-review.googlesource.com/1227032 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent ab5fb5ed
......@@ -173,6 +173,9 @@ gl::Error BufferVk::getIndexRange(const gl::Context *context,
{
ContextVk *contextVk = vk::GetImpl(context);
// Needed before reading buffer or we could get stale data.
ANGLE_TRY(contextVk->getRenderer()->finish(contextVk));
// TODO(jmadill): Consider keeping a shadow system memory copy in some cases.
ASSERT(mBuffer.valid());
......
......@@ -159,7 +159,7 @@ angle::Result VertexArrayVk::convertVertexBuffer(ContextVk *contextVk,
size_t attribIndex)
{
// Preparation for mapping source buffer.
// Needed before reading buffer or we could get stale data.
ANGLE_TRY(contextVk->getRenderer()->finish(contextVk));
unsigned srcFormatSize = mCurrentArrayBufferFormats[attribIndex]->angleFormat().pixelBytes;
......@@ -541,6 +541,9 @@ angle::Result VertexArrayVk::updateIndexTranslation(ContextVk *contextVk,
}
else
{
// Needed before reading buffer or we could get stale data.
ANGLE_TRY(contextVk->getRenderer()->finish(contextVk));
ASSERT(drawCallParams.type() == GL_UNSIGNED_BYTE);
// Unsigned bytes don't have direct support in Vulkan so we have to expand the
// memory to a GLushort.
......
......@@ -118,10 +118,6 @@ class IndexBufferOffsetTest : public ANGLETest
// Test using an offset for an UInt8 index buffer
TEST_P(IndexBufferOffsetTest, UInt8Index)
{
// TODO(lucferron): Add support for unsigned byte elements array buffers
// http://anglebug.com/2659
ANGLE_SKIP_TEST_IF(IsVulkan());
GLubyte indexData[] = {0, 1, 2, 1, 2, 3};
runTest(GL_UNSIGNED_BYTE, 1, indexData);
}
......
......@@ -152,6 +152,10 @@ TEST_P(LineLoopTest, LineLoopUByteIndexBuffer)
TEST_P(LineLoopTest, LineLoopUShortIndexBuffer)
{
// TODO(fjhenigman): Probabe driver bug. Work around it and/or notify vendor.
// http://anglebug.com/2838
ANGLE_SKIP_TEST_IF(IsVulkan() && IsWindows() && IsIntel());
// Disable D3D11 SDK Layers warnings checks, see ANGLE issue 667 for details
ignoreD3D11SDKLayersWarnings();
......
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