Revert "[dawn][vk] Fix uses of pipeline robustness when robustness is disabled."
This reverts commit 20039ea00f3139d13c5ebe85a11c58f2df21c06b.
Reason for revert: breaks the roll into g3, revert before investigating.
Original change's description:
> [dawn][vk] Fix uses of pipeline robustness when robustness is disabled.
>
> When Dawn's robustness is disabled we use pipeline robustness to tell
> the driver to not do any robustness if it can, so we still need to
> enable the Vulkan extension in that case, to allow passing
> VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT.
>
> When robustness is disabled we also need to skip setting the
> VulkanUse*RobustAccess2 toggles since the relevant features are not
> enabled, which would cause a VVL error when they make pipeline
> robustness request "robust access 2".
>
> Fixed: 443940959
> Change-Id: Icb91b2b316b2a543240e5522f9d631862a7cd8a8
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/261175
> Reviewed-by: Kyle Charbonneau <kylechar@google.com>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Brandon Jones <bajones@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ibc9175d462fbd840f621b5350c55a0a39cf11acd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/264694
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
diff --git a/src/dawn/native/vulkan/DeviceVk.cpp b/src/dawn/native/vulkan/DeviceVk.cpp
index a51e279..e298e94 100644
--- a/src/dawn/native/vulkan/DeviceVk.cpp
+++ b/src/dawn/native/vulkan/DeviceVk.cpp
@@ -448,15 +448,6 @@
usedKnobs.features.shaderSampledImageArrayDynamicIndexing = VK_TRUE;
usedKnobs.features.shaderStorageImageArrayDynamicIndexing = VK_TRUE;
- // Always enable pipeline robustness if available as it allows both better control of robustness
- // when we want it, and to give hints to not do any robustness when we don't need it.
- if (mDeviceInfo.HasExt(DeviceExt::PipelineRobustness)) {
- DAWN_ASSERT(usedKnobs.HasExt(DeviceExt::PipelineRobustness));
-
- usedKnobs.pipelineRobustnessFeatures = mDeviceInfo.pipelineRobustnessFeatures;
- featuresChain.Add(&usedKnobs.pipelineRobustnessFeatures);
- }
-
if (IsRobustnessEnabled()) {
usedKnobs.features.robustBufferAccess = VK_TRUE;
@@ -470,6 +461,14 @@
featuresChain.Add(&usedKnobs.robustness2Features);
}
+ // Enable pipelineRobustness to better control where robustness happens.
+ if (mDeviceInfo.HasExt(DeviceExt::PipelineRobustness)) {
+ DAWN_ASSERT(usedKnobs.HasExt(DeviceExt::PipelineRobustness));
+
+ usedKnobs.pipelineRobustnessFeatures = mDeviceInfo.pipelineRobustnessFeatures;
+ featuresChain.Add(&usedKnobs.pipelineRobustnessFeatures);
+ }
+
// robustBufferAccess requires robustBufferAccessUpdateAfterBind to be used with bindless
// enabled. If it is not available, we manual implement robustness for shader buffers and
// rely on pipelineRobustness for vertex buffer robustness.
diff --git a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
index 22ce506..8467b71 100644
--- a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
+++ b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
@@ -1116,8 +1116,7 @@
// By default try to skip injecting robustness checks on textures using VK_EXT_robustness2. But
// disable that optimization when the feature is not available.
- if (deviceToggles->IsSet(Toggle::DisableRobustness) ||
- !GetDeviceInfo().HasExt(DeviceExt::Robustness2) ||
+ if (!GetDeviceInfo().HasExt(DeviceExt::Robustness2) ||
GetDeviceInfo().robustness2Features.robustImageAccess2 == VK_FALSE) {
deviceToggles->ForceSet(Toggle::VulkanUseImageRobustAccess2, false);
} else {
@@ -1127,8 +1126,7 @@
// By default try to skip injecting robustness checks on buffers using VK_EXT_robustness2. But
// disable that optimization when the feature is not available or if it conflicts with bindless
// support (see comment in the detection of bindless support for more details).
- if (deviceToggles->IsSet(Toggle::DisableRobustness) ||
- !GetDeviceInfo().HasExt(DeviceExt::Robustness2) ||
+ if (!GetDeviceInfo().HasExt(DeviceExt::Robustness2) ||
GetDeviceInfo().robustness2Features.robustBufferAccess2 == VK_FALSE) {
deviceToggles->ForceSet(Toggle::VulkanUseBufferRobustAccess2, false);
} else if (GetDeviceInfo().HasExt(DeviceExt::DescriptorIndexing) &&