Commit 198658a3 by Jamie Madill Committed by Commit Bot

Vulkan: Force a flush in ContextVk::onDestroy.

Otherwise we could potentially be destroying resources that are currently in use. Was caught by changing some of the test tear down ordering. Also might affect some of the dEQP EGL multithread tests. Requires fixing the serial tracking of the "null" buffer. Otherwise we could be destroying the null buffer in the incorrect order. Bug: angleproject:3261 Bug: angleproject:3059 Change-Id: I57d1059ce9b1da19ced8ac753fab80c625901066 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1531291Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent a683628b
...@@ -116,6 +116,9 @@ ContextVk::~ContextVk() = default; ...@@ -116,6 +116,9 @@ ContextVk::~ContextVk() = default;
void ContextVk::onDestroy(const gl::Context *context) void ContextVk::onDestroy(const gl::Context *context)
{ {
// Force a flush on destroy.
(void)mRenderer->finish(this);
mDriverUniformsSetLayout.reset(); mDriverUniformsSetLayout.reset();
mIncompleteTextures.onDestroy(context); mIncompleteTextures.onDestroy(context);
mDriverUniformsBuffer.destroy(getDevice()); mDriverUniformsBuffer.destroy(getDevice());
......
...@@ -138,7 +138,7 @@ VertexArrayVk::VertexArrayVk(ContextVk *contextVk, const gl::VertexArrayState &s ...@@ -138,7 +138,7 @@ VertexArrayVk::VertexArrayVk(ContextVk *contextVk, const gl::VertexArrayState &s
mCurrentArrayBufferHandles.fill(mTheNullBuffer.getBuffer().getHandle()); mCurrentArrayBufferHandles.fill(mTheNullBuffer.getBuffer().getHandle());
mCurrentArrayBufferOffsets.fill(0); mCurrentArrayBufferOffsets.fill(0);
mCurrentArrayBuffers.fill(nullptr); mCurrentArrayBuffers.fill(&mTheNullBuffer);
for (vk::DynamicBuffer &buffer : mCurrentArrayBufferConversion) for (vk::DynamicBuffer &buffer : mCurrentArrayBufferConversion)
{ {
...@@ -438,7 +438,7 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk, ...@@ -438,7 +438,7 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk,
{ {
if (bufferVk->getSize() == 0) if (bufferVk->getSize() == 0)
{ {
mCurrentArrayBuffers[attribIndex] = nullptr; mCurrentArrayBuffers[attribIndex] = &mTheNullBuffer;
mCurrentArrayBufferHandles[attribIndex] = mCurrentArrayBufferHandles[attribIndex] =
mTheNullBuffer.getBuffer().getHandle(); mTheNullBuffer.getBuffer().getHandle();
mCurrentArrayBufferOffsets[attribIndex] = 0; mCurrentArrayBufferOffsets[attribIndex] = 0;
...@@ -458,7 +458,7 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk, ...@@ -458,7 +458,7 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk,
} }
else else
{ {
mCurrentArrayBuffers[attribIndex] = nullptr; mCurrentArrayBuffers[attribIndex] = &mTheNullBuffer;
mCurrentArrayBufferHandles[attribIndex] = mTheNullBuffer.getBuffer().getHandle(); mCurrentArrayBufferHandles[attribIndex] = mTheNullBuffer.getBuffer().getHandle();
mCurrentArrayBufferOffsets[attribIndex] = 0; mCurrentArrayBufferOffsets[attribIndex] = 0;
stride = vertexFormat.bufferFormat().pixelBytes; stride = vertexFormat.bufferFormat().pixelBytes;
...@@ -473,7 +473,7 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk, ...@@ -473,7 +473,7 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk,
contextVk->invalidateDefaultAttribute(attribIndex); contextVk->invalidateDefaultAttribute(attribIndex);
// These will be filled out by the ContextVk. // These will be filled out by the ContextVk.
mCurrentArrayBuffers[attribIndex] = nullptr; mCurrentArrayBuffers[attribIndex] = &mTheNullBuffer;
mCurrentArrayBufferHandles[attribIndex] = mTheNullBuffer.getBuffer().getHandle(); mCurrentArrayBufferHandles[attribIndex] = mTheNullBuffer.getBuffer().getHandle();
mCurrentArrayBufferOffsets[attribIndex] = 0; mCurrentArrayBufferOffsets[attribIndex] = 0;
......
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