Commit df4b6316 by Frank Henigman Committed by Commit Bot

Vulkan: Add unmap in BufferVk::getIndexRange.

There was a map() without a corresponding unmap(). Add a test which does multiple indexed draws, triggering the problem. BUG=angleproject:2310 Change-Id: Id33d66f24de2005ec3f9958d33ab4c2630b49dc5 Reviewed-on: https://chromium-review.googlesource.com/875318Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
parent 8d986bf2
...@@ -172,6 +172,7 @@ gl::Error BufferVk::getIndexRange(const gl::Context *context, ...@@ -172,6 +172,7 @@ gl::Error BufferVk::getIndexRange(const gl::Context *context,
*outRange = gl::ComputeIndexRange(type, mapPointer, count, primitiveRestartEnabled); *outRange = gl::ComputeIndexRange(type, mapPointer, count, primitiveRestartEnabled);
mBufferMemory.unmap(device);
return gl::NoError(); return gl::NoError();
} }
......
...@@ -518,6 +518,22 @@ TEST_P(SimpleOperationTest, DrawIndexedQuad) ...@@ -518,6 +518,22 @@ TEST_P(SimpleOperationTest, DrawIndexedQuad)
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green); EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
} }
// Simple repeated indexed draw and swap test.
TEST_P(SimpleOperationTest, DrawIndexedQuadAndSwap)
{
ANGLE_GL_PROGRAM(program, kBasicVertexShader, kGreenFragmentShader);
for (int i = 0; i < 8; ++i)
{
drawIndexedQuad(program.get(), "position", 0.5f, 1.0f, true);
ASSERT_GL_NO_ERROR();
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
swapBuffers();
}
ASSERT_GL_NO_ERROR();
}
// Draw with a fragment uniform. // Draw with a fragment uniform.
TEST_P(SimpleOperationTest, DrawQuadWithFragmentUniform) TEST_P(SimpleOperationTest, DrawQuadWithFragmentUniform)
{ {
......
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