From d84d7f1ea3280e90e27242df50334133513ed8da Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Thu, 30 Sep 2021 18:47:21 +0000 Subject: [PATCH] Disable DrawIndexedIndirect Not passing CTS yet Bug: dawn:809 Change-Id: Ib7c240372a8fdbd45803230292c374e2957c8d15 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65601 Reviewed-by: Ben Clayton Reviewed-by: Kai Ninomiya Commit-Queue: Austin Eng --- src/dawn_native/RenderEncoderBase.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dawn_native/RenderEncoderBase.cpp b/src/dawn_native/RenderEncoderBase.cpp index 4f44f2290a..993bc66abe 100644 --- a/src/dawn_native/RenderEncoderBase.cpp +++ b/src/dawn_native/RenderEncoderBase.cpp @@ -169,6 +169,14 @@ namespace dawn_native { DAWN_TRY(ValidateCanUseAs(indirectBuffer, wgpu::BufferUsage::Indirect)); DAWN_TRY(mCommandBufferState.ValidateCanDrawIndexed()); + // Disallow draw indexed indirect until the validation is correctly implemented. + if (GetDevice()->IsToggleEnabled(Toggle::DisallowUnsafeAPIs)) { + return DAWN_VALIDATION_ERROR( + "DrawIndexedIndirect is disallowed because it doesn't correctly " + "validate that " + "the index range is valid yet."); + } + DAWN_INVALID_IF(indirectOffset % 4 != 0, "Indirect offset (%u) is not a multiple of 4.", indirectOffset);