# DX12 Debug Layer doesn't output detailed error information

When I use the CreateGraphicsPipelineState function in DX12, there's an error "E_INVALIDARG One or more arguments are invalid." returned by the function, but there isn't detailed information on which argument is wrong. I'm sure I opened the debug layer, here is the code:

#if defined(DEBUG) || defined(_DEBUG)
{
ComPtr<ID3D12Debug> debugController;
if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debugController))))
{
debugController->EnableDebugLayer();
}
}
#endif


I also opened the debug layer in the DirectX Control Panel. And it also has no detailed error information in the output window. I really can not find which argument is wrong. Here is my code:

//
// PSO for shadow map pass.
//
{
};
{
};

// Shadow map pass does not have a render target.
ThrowIfFailed(hr);


basePsoDesc is used for creating test pso:

D3D12_GRAPHICS_PIPELINE_STATE_DESC basePsoDesc;
ZeroMemory(&basePsoDesc, sizeof(D3D12_GRAPHICS_PIPELINE_STATE_DESC));
basePsoDesc.pRootSignature = mRootSignature.Get();
basePsoDesc.VS =
{
};
basePsoDesc.PS =
{
};
basePsoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);
basePsoDesc.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT);
basePsoDesc.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC(D3D12_DEFAULT);
basePsoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
basePsoDesc.NumRenderTargets = 1;
basePsoDesc.RTVFormats[0] = mBackBufferFormat;
basePsoDesc.SampleDesc.Count = m4xMsaaState ? 4 : 1;
basePsoDesc.SampleDesc.Quality = m4xMsaaState ? (m4xMsaaQuality - 1) : 0;
basePsoDesc.DSVFormat = mDepthStencilFormat;
ThrowIfFailed(md3dDevice->CreateGraphicsPipelineState(&basePsoDesc, IID_PPV_ARGS(&mPSOs["test"])));


mLoadModelInputLayout =
{
{ "POSITION",     0, DXGI_FORMAT_R32G32B32_FLOAT,   0,   0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "NORMAL",       0, DXGI_FORMAT_R32G32B32_FLOAT,   1,   0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "TANGENT",      0, DXGI_FORMAT_R32G32B32_FLOAT,   2,   0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "TEXCOORD",     0, DXGI_FORMAT_R32G32_FLOAT,      3,   0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
};


struct VertexIn
{
float3 posL : POSITION;
};

struct VertexOut
{
float4 posH : SV_POSITION;
};

VertexOut VS(VertexIn vin)
{
VertexOut vout;
float4 posW = mul(float4(vin.posL, 1.0f), mxWorld);
vout.posH = mul(posW, mxViewProj);
return vout;
}

void PS(VertexOut vout)
{

}


who can tell me why there is no detailed error information output or where the code is wrong? thanks

• Just to be sure - you're looking in the Output pane in Visual Studio, with the VS debugger attached to the app? The debug layer output doesn't get printed to the console, but only to the debugger output. Oct 9 at 16:44
• Also, one thing that might be amiss is that you have a pixel shader, but zero render targets for the shadow pass. Ordinarily in that case there would just not be a pixel shader (shadowPsoDesc.PS = { nullptr, 0 }). (Although you still could have a pixel shader if you wanted to use discard or modify the written depth, so this is not necessarily an error.) Oct 9 at 16:46
• well, the output plane only displayed the "E_INVALIDARG" and "_com_error". It doesn't display detailed error information. I guess there may be a pointer error but I don't know which one it is. Oct 10 at 1:14
• Oh, I just remembered that on Windows 10 there's a special extra thing you have to turn on in order to get the debug layer: docs.microsoft.com/en-us/windows/win32/direct3d11/… - see "enable the "Graphics Tools" optional feature". Have you done that? Oct 10 at 1:49
• yes, Graphics tools are already installed on my system. Oct 10 at 2:11