diff --git a/src/dawn/native/IndirectDrawValidationEncoder.cpp b/src/dawn/native/IndirectDrawValidationEncoder.cpp index c63f9d0f34..a94cfa5783 100644 --- a/src/dawn/native/IndirectDrawValidationEncoder.cpp +++ b/src/dawn/native/IndirectDrawValidationEncoder.cpp @@ -212,6 +212,8 @@ ResultOrError GetOrCreateRenderValidationPipeline(DeviceBa computePipelineDescriptor.compute.module = store->renderValidationShader.Get(); computePipelineDescriptor.compute.entryPoint = "main"; + // This will create new resource so we have to lock the device. + auto deviceLock(device->GetScopedLock()); DAWN_TRY_ASSIGN(store->renderValidationPipeline, device->CreateComputePipeline(&computePipelineDescriptor)); }