Commit cc3e7b5d by Mohan Maiya Committed by Commit Bot

Vulkan: Handle GL_MAP_PERSISTENT_BIT_EXT for external buffer

When user specifies GL_MAP_PERSISTENT_BIT_EXT bit for an external buffer but we are unable to import it into a memoryType that supports host visibility, error out with GL_INVALID_OPERATION error. Bug: angleproject:5073 Bug: angleproject:5909 Change-Id: I03e5477266dfb705bfb0a1bce5ca003049ef4c7a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2862560 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent eb6548bb
......@@ -293,7 +293,16 @@ angle::Result BufferVk::setDataWithUsageFlags(const gl::Context *context,
if (isExternalBuffer)
{
return setExternalBufferData(context, target, clientBuffer, size, memoryPropertyFlags);
ANGLE_TRY(setExternalBufferData(context, target, clientBuffer, size, memoryPropertyFlags));
if (!mBuffer->isHostVisible())
{
// If external buffer's memory does not support host visible memory property, we cannot
// support a persistent map request.
ANGLE_VK_CHECK(vk::GetImpl(context), !persistentMapRequired,
VK_ERROR_MEMORY_MAP_FAILED);
}
return angle::Result::Continue;
}
return setDataWithMemoryType(context, target, data, size, memoryPropertyFlags,
persistentMapRequired);
......
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