DiligentGraphics / DiligentSamples

Sample projects demonstrating the usage of Diligent Engine
http://diligentgraphics.com/diligent-engine/samples/
Apache License 2.0
320 stars 80 forks source link

Tutorial20_MeshShader crashing with DX 12 on startup, Vulkan works #114

Closed richardeakin closed 2 months ago

richardeakin commented 1 year ago

Trying to run "Tutorial 20 - Mesh Shader" here and it works on Vulkan but not DX 12. dxdiag reports that my graphics card supports DX Feature Level 12_2 and I'm on the latest drivers.

Log output from startup:

Diligent Engine: Info: Using adapter 0: 'NVIDIA GeForce RTX 2080 SUPER'
Diligent Engine: Info: User-defined allocator is not provided. Using default allocator.
Diligent Engine: Info: D3D12-capable adapter found: NVIDIA GeForce RTX 2080 SUPER (8010 MB)
Diligent Engine: Info: User-defined allocator is not provided. Using default allocator.
Diligent Engine: Info: Created dynamic memory page. Size: 1.00 MB; GPU virtual address 0x83e3000
Diligent Engine: Info: Max device shader model: 6_6
D3D12 WARNING: ID3D12Device::CreateCommittedResource: Ignoring InitialState D3D12_RESOURCE_STATE_COPY_DEST. Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON. [ STATE_CREATION WARNING #1328: CREATERESOURCE_STATE_IGNORED]
D3D12 WARNING: ID3D12Device::CreateCommittedResource: Ignoring InitialState D3D12_RESOURCE_STATE_COPY_DEST. Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON. [ STATE_CREATION WARNING #1328: CREATERESOURCE_STATE_IGNORED]
Diligent Engine: Info: Loaded DX Shader Compiler 1.6. Max supported shader model: 6.6
Exception thrown at 0x00007FF948640D92 (nvwgf2umx.dll) in Tutorial20_MeshShader.exe: 0xC0000005: Access violation reading location 0x0000000000000004.

It's crashing in the CreatePipelineState() call, here:

image

Relevant call stack:

    GraphicsEngineD3D12_64d.dll!Diligent::PipelineStateD3D12Impl::PipelineStateD3D12Impl(Diligent::IReferenceCounters * pRefCounters, Diligent::RenderDeviceD3D12Impl * pDeviceD3D12, const Diligent::GraphicsPipelineStateCreateInfo & CreateInfo) Line 867    C++
    GraphicsEngineD3D12_64d.dll!Diligent::MakeNewRCObj<Diligent::PipelineStateD3D12Impl,Diligent::FixedBlockMemoryAllocator>::operator()<Diligent::RenderDeviceD3D12Impl *,Diligent::GraphicsPipelineStateCreateInfo const &>(Diligent::RenderDeviceD3D12Impl * && <CtorArgs_0>, const Diligent::GraphicsPipelineStateCreateInfo & <CtorArgs_1>) Line 670   C++
    GraphicsEngineD3D12_64d.dll!Diligent::RenderDeviceBase<Diligent::EngineD3D12ImplTraits>::CreatePipelineStateImpl::__l2::<lambda>() Line 394 C++
    GraphicsEngineD3D12_64d.dll!Diligent::RenderDeviceBase<Diligent::EngineD3D12ImplTraits>::CreateDeviceObject<Diligent::IPipelineState,Diligent::PipelineStateDesc,void <lambda>(void)>(const char * ObjectTypeName, const Diligent::PipelineStateDesc & Desc, Diligent::IPipelineState * * ppObject, Diligent::RenderDeviceBase<Diligent::EngineD3D12ImplTraits>::CreatePipelineStateImpl::__l2::void <lambda>(void) ConstructObject) Line 366   C++
    GraphicsEngineD3D12_64d.dll!Diligent::RenderDeviceBase<Diligent::EngineD3D12ImplTraits>::CreatePipelineStateImpl<Diligent::GraphicsPipelineStateCreateInfo>(Diligent::IPipelineState * * ppPipelineState, const Diligent::GraphicsPipelineStateCreateInfo & PSOCreateInfo) Line 397 C++
    GraphicsEngineD3D12_64d.dll!Diligent::RenderDeviceD3D12Impl::CreateGraphicsPipelineState(const Diligent::GraphicsPipelineStateCreateInfo & PSOCreateInfo, Diligent::IPipelineState * * ppPipelineState) Line 533    C++
>   Tutorial20_MeshShader.exe!Diligent::Tutorial20_MeshShader::CreatePipelineState() Line 304   C++
    Tutorial20_MeshShader.exe!Diligent::Tutorial20_MeshShader::Initialize(const Diligent::SampleInitInfo & InitInfo) Line 350   C++
    Tutorial20_MeshShader.exe!Diligent::SampleApp::InitializeSample() Line 477  C++
    Tutorial20_MeshShader.exe!Diligent::SampleAppWin32::OnWindowCreated(HWND__ * hWnd, long WindowWidth, long WindowHeight) Line 196    C++
    Tutorial20_MeshShader.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nShowCmd) Line 103    C++

Other details:

TheMostDiligent commented 11 months ago

@richardeakin Can you check if this work in the latest version? The tutorial runs fine on NVIDIA GeForce RTX 2070 SUPER

TheMostDiligent commented 2 months ago

Fixed in https://github.com/DiligentGraphics/DiligentEngine/commit/a2f6940c47088d41b4bc4bcf2a58e8d01bae0402