Commit 17a50e17 by Jamie Madill Committed by Commit Bot

Vulkan: Enable robust buffer access.

This is not a complete implementation because it does not have the ability to disable the physical device feature. It does pass the current set of robust access tests. But there could be a performance regression on platforms that have a slower impelmentation. We would want the ability to support cases with bufer robustness on or off. Bug: angleproject:3062 Change-Id: I7d6eb889debcbd32f6ed809b526677123f872726 Reviewed-on: https://chromium-review.googlesource.com/c/1403967Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent c759b8b4
...@@ -843,6 +843,7 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF ...@@ -843,6 +843,7 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF
// Select additional features to be enabled // Select additional features to be enabled
VkPhysicalDeviceFeatures enabledFeatures = {}; VkPhysicalDeviceFeatures enabledFeatures = {};
enabledFeatures.inheritedQueries = mPhysicalDeviceFeatures.inheritedQueries; enabledFeatures.inheritedQueries = mPhysicalDeviceFeatures.inheritedQueries;
enabledFeatures.robustBufferAccess = mPhysicalDeviceFeatures.robustBufferAccess;
VkDeviceQueueCreateInfo queueCreateInfo = {}; VkDeviceQueueCreateInfo queueCreateInfo = {};
......
...@@ -450,11 +450,23 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk, ...@@ -450,11 +450,23 @@ angle::Result VertexArrayVk::syncDirtyAttrib(ContextVk *contextVk,
} }
else else
{ {
if (bufferVk->getSize() == 0)
{
mCurrentArrayBuffers[attribIndex] = nullptr;
mCurrentArrayBufferHandles[attribIndex] =
mTheNullBuffer.getBuffer().getHandle();
mCurrentArrayBufferOffsets[attribIndex] = 0;
mCurrentArrayBufferStrides[attribIndex] = 0;
}
else
{
mCurrentArrayBuffers[attribIndex] = &bufferVk->getBuffer(); mCurrentArrayBuffers[attribIndex] = &bufferVk->getBuffer();
mCurrentArrayBufferHandles[attribIndex] = mCurrentArrayBufferHandles[attribIndex] =
bufferVk->getBuffer().getBuffer().getHandle(); bufferVk->getBuffer().getBuffer().getHandle();
mCurrentArrayBufferOffsets[attribIndex] = binding.getOffset(); mCurrentArrayBufferOffsets[attribIndex] = binding.getOffset();
mCurrentArrayBufferStrides[attribIndex] = binding.getStride(); mCurrentArrayBufferStrides[attribIndex] = binding.getStride();
}
ensureConversionReleased(renderer, attribIndex); ensureConversionReleased(renderer, attribIndex);
} }
} }
......
...@@ -50,6 +50,9 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties, ...@@ -50,6 +50,9 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
outExtensions->textureBorderClamp = false; // not implemented yet outExtensions->textureBorderClamp = false; // not implemented yet
outExtensions->translatedShaderSource = true; outExtensions->translatedShaderSource = true;
// Only expose robust buffer access if the physical device supports it.
outExtensions->robustBufferAccessBehavior = physicalDeviceFeatures.robustBufferAccess;
// We use secondary command buffers almost everywhere and they require a feature to be // We use secondary command buffers almost everywhere and they require a feature to be
// able to execute in the presence of queries. As a result, we won't support queries // able to execute in the presence of queries. As a result, we won't support queries
// unless that feature is available. // unless that feature is available.
......
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