All input appears valid, although the DirectX12.ShaderByteCode() pointer is null - I don't know if that's indicative of anything; the buffer does contain data.

Edit: Diagnostic hub output:

Profiling of 'Graphics Frame Capture' started.
Graphics Frame Capture has exited.
Profiling of 'Graphics Frame Capture' stopped.

Edit2: Debug output:

Exception thrown: 'System.Runtime.InteropServices.SEHException' in SharpDX.Direct3D12
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in SharpDX.Direct3D12
External component has thrown an exception.


var pipelineStateDesc =
    new GraphicsPipelineStateDescription
        BlendState =
        DepthStencilFormat = SharpDX.DXGI.Format.D32_Float,
        DepthStencilState =
            new DepthStencilStateDescription
                IsDepthEnabled = false,
                IsStencilEnabled = false
        Flags = PipelineStateFlags.None,
        InputLayout = inputLayout,
        PixelShader =
            new ShaderBytecode(pShader),
        PrimitiveTopologyType =
        RasterizerState =
        RenderTargetCount = 1,
        RootSignature = rootSignature,
        SampleDescription =
            new SharpDX.DXGI.SampleDescription(1, 0),
        StreamOutput =
            new StreamOutputDescription(),
        SampleMask = int.MaxValue,
        VertexShader =
            new ShaderBytecode(vShader)

pipelineStateDesc.RenderTargetFormats[0] =

// Crash happens here.
// Pointer-to-implementation.
// .GetDevice returns the SharpDX.Direct3D12.Device.
pipelineState =
  • \$\begingroup\$ Enable the debug device and look for diagnostic output. \$\endgroup\$ – Chuck Walbourn Jun 5 '18 at 5:59
  • \$\begingroup\$ Sorry, insomnia. Using the debug device, CreateDevice crashed with "Invalid parameter". Using "CheckFeatureSupport()" with debug off returned false and a max feature level of 12.1, so I'm not sure what that means. \$\endgroup\$ – Narf the Mouse Jun 5 '18 at 17:28
  • \$\begingroup\$ Ignore previous message; I had "break on" set for info and message. Updating with diagnostic hub output on CreateGraphicsPipelineState. \$\endgroup\$ – Narf the Mouse Jun 5 '18 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.