Vulkan: Remove the bindEmptyForUnusedDescriptorSets workaround

Only applied to older Qualcomm-based phones.

Bug: angleproject:2727
Change-Id: I37a611e2ff79d898eff9401467407543f3c690b8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3785290
Reviewed-by: Charlie Lao <cclao@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
This commit is contained in:
Shahbaz Youssefi 2022-07-25 15:24:52 -04:00 коммит произвёл Angle LUCI CQ
Родитель 673a41ae66
Коммит be70844665
9 изменённых файлов: 6 добавлений и 59 удалений

Просмотреть файл

@ -221,11 +221,6 @@ struct FeaturesVk : FeatureSetBase
"disableFifoPresentMode", FeatureCategory::VulkanWorkarounds,
"VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members, "http://anglebug.com/3153"};
FeatureInfo bindEmptyForUnusedDescriptorSets = {
"bindEmptyForUnusedDescriptorSets", FeatureCategory::VulkanWorkarounds,
"Gaps in bound descriptor set indices causes the post-gap sets to misbehave", &members,
"http://anglebug.com/2727"};
FeatureInfo forceD16TexFilter = {
"forceD16TexFilter", FeatureCategory::VulkanWorkarounds,
"VK_FORMAT_D16_UNORM does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, "

Просмотреть файл

@ -264,14 +264,6 @@
],
"issue": "http://anglebug.com/3153"
},
{
"name": "bind_empty_for_unused_descriptor_sets",
"category": "Workarounds",
"description": [
"Gaps in bound descriptor set indices causes the post-gap sets to misbehave"
],
"issue": "http://anglebug.com/2727"
},
{
"name": "force_D16_tex_filter",
"category": "Workarounds",

Просмотреть файл

@ -6,7 +6,7 @@
"include/platform/FeaturesMtl_autogen.h":
"6b6d49c35bc9246361f8dac0a5445a02",
"include/platform/FeaturesVk_autogen.h":
"98df364d7ba96f4aaa6c5f6940492eab",
"816ce4ef901605dbe0d03edf3eb4f3b5",
"include/platform/FrontendFeatures_autogen.h":
"1781e4fa6efb552bca2ce5a5164eb374",
"include/platform/d3d_features.json":
@ -20,9 +20,9 @@
"include/platform/mtl_features.json":
"1fabfe4d5c2eb3683a5b567ab60ad83c",
"include/platform/vk_features.json":
"1cc54c85cf96d60167fc6ed2c2a8817b",
"3574d1618307a49d242a424c0d79a8a3",
"util/angle_features_autogen.cpp":
"4918af5e120a0f41176ce2d3c9d487db",
"4c8feb678e0aff9c853d4aec094c2528",
"util/angle_features_autogen.h":
"5044ccab750c63f3cd6414cf45241abb"
"7d9d5092bb61cc298733a6c9a2dfd598"
}

Просмотреть файл

@ -344,8 +344,7 @@ void ProgramInfo::release(ContextVk *contextVk)
}
ProgramExecutableVk::ProgramExecutableVk()
: mEmptyDescriptorSets{},
mNumDefaultUniformDescriptors(0),
: mNumDefaultUniformDescriptors(0),
mImmutableSamplersMaxDescriptorCount(1),
mUniformBufferDescriptorType(VK_DESCRIPTOR_TYPE_MAX_ENUM),
mDynamicUniformDescriptorOffsets{}
@ -372,7 +371,6 @@ void ProgramExecutableVk::resetLayout(ContextVk *contextVk)
mPipelineLayout.reset();
mDescriptorSets.fill(VK_NULL_HANDLE);
mEmptyDescriptorSets.fill(VK_NULL_HANDLE);
mNumDefaultUniformDescriptors = 0;
for (vk::RefCountedDescriptorPoolBinding &binding : mDescriptorPoolBindings)
@ -1455,21 +1453,7 @@ angle::Result ProgramExecutableVk::bindDescriptorSets(
VkDescriptorSet descSet = mDescriptorSets[descriptorSetIndex];
if (descSet == VK_NULL_HANDLE)
{
if (!context->getRenderer()->getFeatures().bindEmptyForUnusedDescriptorSets.enabled)
{
continue;
}
// Workaround a driver bug where missing (though unused) descriptor sets indices cause
// later sets to misbehave.
if (mEmptyDescriptorSets[descriptorSetIndex] == VK_NULL_HANDLE)
{
ANGLE_TRY(mDescriptorPools[descriptorSetIndex].get().allocateDescriptorSet(
context, commandBufferHelper, mDescriptorSetLayouts[descriptorSetIndex].get(),
&mDescriptorPoolBindings[descriptorSetIndex],
&mEmptyDescriptorSets[descriptorSetIndex]));
}
descSet = mEmptyDescriptorSets[descriptorSetIndex];
continue;
}
// Default uniforms are encompassed in a block per shader stage, and they are assigned

Просмотреть файл

@ -336,7 +336,6 @@ class ProgramExecutableVk
// Descriptor sets and pools for shader resources for this program.
vk::DescriptorSetArray<VkDescriptorSet> mDescriptorSets;
vk::DescriptorSetArray<VkDescriptorSet> mEmptyDescriptorSets;
vk::DescriptorSetArray<vk::DescriptorPoolPointer> mDescriptorPools;
vk::DescriptorSetArray<vk::RefCountedDescriptorPoolBinding> mDescriptorPoolBindings;
uint32_t mNumDefaultUniformDescriptors;

Просмотреть файл

@ -3362,9 +3362,6 @@ void RendererVk::initFeatures(DisplayVk *displayVk,
ANGLE_FEATURE_CONDITION(&mFeatures, disableFifoPresentMode, IsLinux() && isIntel);
ANGLE_FEATURE_CONDITION(&mFeatures, bindEmptyForUnusedDescriptorSets,
IsAndroid() && isQualcommProprietary);
ANGLE_FEATURE_CONDITION(&mFeatures, perFrameWindowSizeQuery,
IsAndroid() || isIntel || (IsWindows() && isAMD) || IsFuchsia() ||
isSamsung || displayVk->isWayland());

Просмотреть файл

@ -903,24 +903,6 @@ angle::Result InitDynamicDescriptorPool(Context *context,
}
}
if (descriptorPoolSizes.empty())
{
if (context->getRenderer()->getFeatures().bindEmptyForUnusedDescriptorSets.enabled)
{
// For this workaround, we have to create an empty descriptor set for each descriptor
// set index, so make sure their pools are initialized.
VkDescriptorPoolSize poolSize = {};
// The type doesn't matter, since it's not actually used for anything.
poolSize.type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
poolSize.descriptorCount = 1;
descriptorPoolSizes.emplace_back(poolSize);
}
else
{
return angle::Result::Continue;
}
}
if (!descriptorPoolSizes.empty())
{
ANGLE_TRY(poolToInit->init(context, descriptorPoolSizes.data(), descriptorPoolSizes.size(),

Просмотреть файл

@ -41,7 +41,6 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{
{Feature::AsyncCommandQueue, "asyncCommandQueue"},
{Feature::Avoid1BitAlphaTextureFormats, "avoid1BitAlphaTextureFormats"},
{Feature::BasicGLLineRasterization, "basicGLLineRasterization"},
{Feature::BindEmptyForUnusedDescriptorSets, "bindEmptyForUnusedDescriptorSets"},
{Feature::BindTransformFeedbackBufferBeforeBindBufferRange,
"bindTransformFeedbackBufferBeforeBindBufferRange"},
{Feature::BottomLeftOriginPresentRegionRectangles, "bottomLeftOriginPresentRegionRectangles"},

Просмотреть файл

@ -40,7 +40,6 @@ enum class Feature
AsyncCommandQueue,
Avoid1BitAlphaTextureFormats,
BasicGLLineRasterization,
BindEmptyForUnusedDescriptorSets,
BindTransformFeedbackBufferBeforeBindBufferRange,
BottomLeftOriginPresentRegionRectangles,
BresenhamLineRasterization,