Vulkan: Enable robust buffer access if validation is on
Bug: dawn:480 Change-Id: Id145fab2fe24b70a063c3cc1f75f0a565635abf8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24182 Commit-Queue: Idan Raiter <idanr@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
509b811a75
commit
bcc65f2d48
|
@ -832,6 +832,10 @@ namespace dawn_native {
|
|||
return !IsToggleEnabled(Toggle::SkipValidation);
|
||||
}
|
||||
|
||||
bool DeviceBase::IsRobustnessEnabled() const {
|
||||
return !IsToggleEnabled(Toggle::DisableRobustness);
|
||||
}
|
||||
|
||||
size_t DeviceBase::GetLazyClearCountForTesting() {
|
||||
return mLazyClearCountForTesting;
|
||||
}
|
||||
|
|
|
@ -216,6 +216,7 @@ namespace dawn_native {
|
|||
bool IsExtensionEnabled(Extension extension) const;
|
||||
bool IsToggleEnabled(Toggle toggle) const;
|
||||
bool IsValidationEnabled() const;
|
||||
bool IsRobustnessEnabled() const;
|
||||
size_t GetLazyClearCountForTesting();
|
||||
void IncrementLazyClearCountForTesting();
|
||||
size_t GetDeprecationWarningCountForTesting();
|
||||
|
|
|
@ -131,6 +131,8 @@ namespace dawn_native {
|
|||
{Toggle::UseDXC,
|
||||
{"use_dxc", "Use DXC instead of FXC for compiling HLSL",
|
||||
"https://crbug.com/dawn/402"}},
|
||||
{Toggle::DisableRobustness,
|
||||
{"disable_robustness", "Disable robust buffer access", "https://crbug.com/dawn/480"}},
|
||||
}};
|
||||
|
||||
} // anonymous namespace
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace dawn_native {
|
|||
DisableBaseInstance,
|
||||
UseD3D12SmallShaderVisibleHeapForTesting,
|
||||
UseDXC,
|
||||
DisableRobustness,
|
||||
|
||||
EnumCount,
|
||||
InvalidEnum = EnumCount,
|
||||
|
|
|
@ -299,6 +299,10 @@ namespace dawn_native { namespace vulkan {
|
|||
// Always require fragmentStoresAndAtomics because it is required by end2end tests.
|
||||
usedKnobs.features.fragmentStoresAndAtomics = VK_TRUE;
|
||||
|
||||
if (IsRobustnessEnabled()) {
|
||||
usedKnobs.features.robustBufferAccess = VK_TRUE;
|
||||
}
|
||||
|
||||
if (mDeviceInfo.HasExt(DeviceExt::SubgroupSizeControl)) {
|
||||
ASSERT(usedKnobs.HasExt(DeviceExt::SubgroupSizeControl));
|
||||
|
||||
|
|
Loading…
Reference in New Issue