Commit 1736c47b by Tobin Ehlis Committed by Commit Bot

Vulkan: Remove transient cmd buffer workaround

We no longer need this workaround. Also mCommandPoolFreeList dead code. Bug: angleproject:3508 Change-Id: Ib73ddd431eb1bf9a55c3421111af4df5976cc1fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033485Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
parent 21a3262e
...@@ -182,16 +182,6 @@ struct FeaturesVk : FeatureSetBase ...@@ -182,16 +182,6 @@ struct FeaturesVk : FeatureSetBase
"Vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE when window resizing", &members, "Vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE when window resizing", &members,
"http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"}; "http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"};
// On Pixel1XL and Pixel2, reset a vkCommandBuffer seems to have side effects on binding
// descriptor sets to it afterwards, Work-around by keep using transient vkCommandBuffer on
// those devices.
// http://b/135763283
Feature transientCommandBuffer = {
"transient_command_buffer", FeatureCategory::VulkanWorkarounds,
"Keep using transient vkCommandBuffer to work around driver issue in reseting"
"vkCommandBuffer",
&members, "http://b/135763283"};
// Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed. // Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed.
Feature disallowSeamfulCubeMapEmulation = { Feature disallowSeamfulCubeMapEmulation = {
"disallow_seamful_cube_map_emulation", FeatureCategory::VulkanWorkarounds, "disallow_seamful_cube_map_emulation", FeatureCategory::VulkanWorkarounds,
......
...@@ -239,10 +239,7 @@ angle::Result CommandQueue::init(vk::Context *context) ...@@ -239,10 +239,7 @@ angle::Result CommandQueue::init(vk::Context *context)
// Initialize the command pool now that we know the queue family index. // Initialize the command pool now that we know the queue family index.
uint32_t queueFamilyIndex = renderer->getQueueFamilyIndex(); uint32_t queueFamilyIndex = renderer->getQueueFamilyIndex();
if (!renderer->getFeatures().transientCommandBuffer.enabled)
{
ANGLE_TRY(mPrimaryCommandPool.init(context, queueFamilyIndex)); ANGLE_TRY(mPrimaryCommandPool.init(context, queueFamilyIndex));
}
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -347,39 +344,14 @@ angle::Result CommandQueue::allocatePrimaryCommandBuffer(vk::Context *context, ...@@ -347,39 +344,14 @@ angle::Result CommandQueue::allocatePrimaryCommandBuffer(vk::Context *context,
const vk::CommandPool &commandPool, const vk::CommandPool &commandPool,
vk::PrimaryCommandBuffer *commandBufferOut) vk::PrimaryCommandBuffer *commandBufferOut)
{ {
RendererVk *renderer = context->getRenderer();
VkDevice device = renderer->getDevice();
if (ANGLE_LIKELY(!renderer->getFeatures().transientCommandBuffer.enabled))
{
return mPrimaryCommandPool.allocate(context, commandBufferOut); return mPrimaryCommandPool.allocate(context, commandBufferOut);
}
VkCommandBufferAllocateInfo commandBufferInfo = {};
commandBufferInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
commandBufferInfo.commandPool = commandPool.getHandle();
commandBufferInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
commandBufferInfo.commandBufferCount = 1;
ANGLE_VK_TRY(context, commandBufferOut->init(device, commandBufferInfo));
return angle::Result::Continue;
} }
angle::Result CommandQueue::releasePrimaryCommandBuffer(vk::Context *context, angle::Result CommandQueue::releasePrimaryCommandBuffer(vk::Context *context,
vk::PrimaryCommandBuffer &&commandBuffer) vk::PrimaryCommandBuffer &&commandBuffer)
{ {
RendererVk *renderer = context->getRenderer();
VkDevice device = renderer->getDevice();
if (ANGLE_LIKELY(!renderer->getFeatures().transientCommandBuffer.enabled))
{
ASSERT(mPrimaryCommandPool.valid()); ASSERT(mPrimaryCommandPool.valid());
ANGLE_TRY(mPrimaryCommandPool.collect(context, std::move(commandBuffer))); ANGLE_TRY(mPrimaryCommandPool.collect(context, std::move(commandBuffer)));
}
else
{
commandBuffer.destroy(device);
}
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -660,11 +632,6 @@ void ContextVk::onDestroy(const gl::Context *context) ...@@ -660,11 +632,6 @@ void ContextVk::onDestroy(const gl::Context *context)
mGpuEventQueryPool.destroy(device); mGpuEventQueryPool.destroy(device);
mCommandPool.destroy(device); mCommandPool.destroy(device);
mPrimaryCommands.destroy(device); mPrimaryCommands.destroy(device);
for (vk::CommandPool &pool : mCommandPoolFreeList)
{
pool.destroy(device);
}
} }
angle::Result ContextVk::getIncompleteTexture(const gl::Context *context, angle::Result ContextVk::getIncompleteTexture(const gl::Context *context,
...@@ -723,19 +690,6 @@ angle::Result ContextVk::initialize() ...@@ -723,19 +690,6 @@ angle::Result ContextVk::initialize()
ANGLE_TRY(mCommandQueue.init(this)); ANGLE_TRY(mCommandQueue.init(this));
if (mRenderer->getFeatures().transientCommandBuffer.enabled)
{
// Once http://anglebug.com/3508 is resolved, the commandPool will only
// used for secondaryBuffer allocation, so we can guard this block of code use macro
// ANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS.
VkCommandPoolCreateInfo commandPoolInfo = {};
commandPoolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
commandPoolInfo.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT;
commandPoolInfo.queueFamilyIndex = mRenderer->getQueueFamilyIndex();
ANGLE_VK_TRY(this, mCommandPool.init(getDevice(), commandPoolInfo));
}
#if ANGLE_ENABLE_VULKAN_GPU_TRACE_EVENTS #if ANGLE_ENABLE_VULKAN_GPU_TRACE_EVENTS
angle::PlatformMethods *platform = ANGLEPlatformCurrent(); angle::PlatformMethods *platform = ANGLEPlatformCurrent();
ASSERT(platform); ASSERT(platform);
......
...@@ -888,7 +888,6 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::RenderPassO ...@@ -888,7 +888,6 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::RenderPassO
// We use a single pool for recording commands. We also keep a free list for pool recycling. // We use a single pool for recording commands. We also keep a free list for pool recycling.
vk::CommandPool mCommandPool; vk::CommandPool mCommandPool;
std::vector<vk::CommandPool> mCommandPoolFreeList;
CommandQueue mCommandQueue; CommandQueue mCommandQueue;
vk::GarbageList mCurrentGarbage; vk::GarbageList mCurrentGarbage;
......
...@@ -1545,11 +1545,6 @@ void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames) ...@@ -1545,11 +1545,6 @@ void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames)
ANGLE_FEATURE_CONDITION((&mFeatures), disableFlippingBlitWithCommand, ANGLE_FEATURE_CONDITION((&mFeatures), disableFlippingBlitWithCommand,
IsAndroid() && isQualcomm); IsAndroid() && isQualcomm);
ANGLE_FEATURE_CONDITION(
(&mFeatures), transientCommandBuffer,
IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) ||
IsPixel1XL(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID));
ANGLE_FEATURE_CONDITION((&mFeatures), commandGraph, true); ANGLE_FEATURE_CONDITION((&mFeatures), commandGraph, true);
angle::PlatformMethods *platform = ANGLEPlatformCurrent(); angle::PlatformMethods *platform = ANGLEPlatformCurrent();
......
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