From 1452cf60e56006b4f2de414a9cddc18559e920e8 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 24 Mar 2021 14:29:53 +0000 Subject: [PATCH] ComputePipelineD3D12 - check result of CreateComputePipelineState() This was silently failing for me, resuling in a crash somewhere completely different. Change-Id: Iba9dfba8bb4c9e51a947a1337fc9718437ad5254 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45766 Commit-Queue: Ben Clayton Reviewed-by: Corentin Wallez --- src/dawn_native/d3d12/ComputePipelineD3D12.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dawn_native/d3d12/ComputePipelineD3D12.cpp b/src/dawn_native/d3d12/ComputePipelineD3D12.cpp index 88aa240ead..4e457d596d 100644 --- a/src/dawn_native/d3d12/ComputePipelineD3D12.cpp +++ b/src/dawn_native/d3d12/ComputePipelineD3D12.cpp @@ -15,6 +15,7 @@ #include "dawn_native/d3d12/ComputePipelineD3D12.h" #include "common/Assert.h" +#include "dawn_native/d3d12/D3D12Error.h" #include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/PipelineLayoutD3D12.h" #include "dawn_native/d3d12/PlatformFunctions.h" @@ -51,8 +52,10 @@ namespace dawn_native { namespace d3d12 { SingleShaderStage::Compute, ToBackend(GetLayout()), compileFlags)); d3dDesc.CS = compiledShader.GetD3D12ShaderBytecode(); - device->GetD3D12Device()->CreateComputePipelineState(&d3dDesc, - IID_PPV_ARGS(&mPipelineState)); + auto* d3d12Device = device->GetD3D12Device(); + DAWN_TRY(CheckHRESULT( + d3d12Device->CreateComputePipelineState(&d3dDesc, IID_PPV_ARGS(&mPipelineState)), + "D3D12 creating pipeline state")); return {}; }