This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.

DirectX-Graphics-Samples

This repo contains the DirectX 12 Graphics samples that demonstrate how to build graphics intensive applications for Windows 10.

We invite you to join us at our discord server. See our YouTube channel for tutorials, our spec repo for engineering specs of our features and devblogs for blog posts. Follow us on Twitter @DirectX12 for the latest! See the related links section for our full list of DX12-related links.

Finally, make sure that you visit the DirectX Landing Page for more resources for DirectX developers.

API Samples

In the Samples directory, you will find samples that attempt to break off specific features and specific usage scenarios into bite-sized chunks. For example, the ExecuteIndirect sample will show you just enough about execute indirect to get started with that feature without diving too deep into multiengine whereas the nBodyGravity sample will delve into multiengine without touching on the execute indirect feature etc. By doing this, we hope to make it easier to get started with DirectX 12.

DirectX 12 Ultimate samples

  1. D3D12 Mesh Shaders: This sample demonstrates how Mesh shaders can be used to increase the flexibility and performance of the geometry pipeline.

    D3D12 Meshlet Render preview
  2. D3D12 Variable Rate Shading: This sample demonstrates how shading rate can be reduced with little or no reduction in visual quality, leading to “free” performance.

    D3D12 Variable Rate Shading GUI
  3. D3D12 Raytracing: This sample demonstrates how DirectX Raytracing (DXR) brings a new level of graphics realism to video games, previously only achievable in the movie industry.

    D3D12 Raytracing Real-Time Denoised Ambient Occlusion preview

MiniEngine: A DirectX 12 Engine Starter Kit

In addition to the samples, we are announcing the first DirectX 12 preview release of the MiniEngine.

It came from a desire to quickly dive into graphics and performance experiments. We knew we would need some basic building blocks whenever starting a new 3D app, and we had already written these things at countless previous gigs. We got tired of reinventing the wheel, so we established our own core library of helper classes and platform abstractions. We wanted to be able to create a new app by writing just the Init(), Update(), and Render() functions and leveraging as much reusable code as possible. Today our core library has been redesigned for DirectX 12 and aims to serve as an example of efficient API usage. It is obviously not exhaustive of what a game engine needs, but it can serve as the cornerstone of something new. You can also borrow whatever useful code you find.

Some features of MiniEngine

  • High-quality anti-aliased text rendering
  • Real-time CPU and GPU profiling
  • User-controlled variables
  • Game controller, mouse, and keyboard input
  • A friendly DirectXMath wrapper
  • Perspective camera supporting traditional and reversed Z matrices
  • Asynchronous DDS texture loading and ZLib decompression
  • Large library of shaders
  • Easy shader embedding via a compile-to-header system
  • Easy render target, depth target, and unordered access view creation
  • A thread-safe GPU command context system (WIP)
  • Easy-to-use dynamic constant buffers and descriptor tables

Requirements

Some samples require support for DirectX 12 Ultimate, see this post for details.

Master branch

This branch is intended for the latest released Windows 10 version.

Develop branch

This branch is intended for features available in the latest Windows Insider Preview

Contributing

We're always looking for your help to fix bugs and improve the samples. File those pull requests and we'll be happy to take a look.

Troubleshooting information for this repository can be found in the site Wiki.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Related links

Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
Comments
  • Raytraced MiniEngine Strange Texture Filtering

    Raytraced MiniEngine Strange Texture Filtering

    Hello,

    I've been browsing through the samples here, and I noticed some weird behavior on the "RaytracingMiniEngineSample," looks like something strange is happening with the texture filtering, but only in specific areas.

    image

    This may already be known, but I didn't see mention of it in the issues.

    I'm on an RTX 2060, i7 3770k, 18362.778

    All the best, Nico.

  • VSGA crashes while inspecting pipeline state

    VSGA crashes while inspecting pipeline state

    I have modified the HelloTriangle sample to read vertex positions from HLSL constants, and while rendering works as expected attempting to analyze the DrawInstanced() call in Visual Studio Graphics Analyzer causes the analyzer to crash. I attempted to submit feedback using Microsoft Connect and I get the following error message: "You are not authorized to submit the feedback for this connection.".

    I have a diagsession that can help reproduce the issue, and I have the modified code that I can share. Where to go to get this fixed?

  • Running MiniEngine Sample removing device DXGI_ERROR_DEVICE_HUNG

    Running MiniEngine Sample removing device DXGI_ERROR_DEVICE_HUNG

    Hi,

    I'm getting the error

    D3D12 ERROR: ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #232: DEVICE_REMOVAL_PROCESS_AT_FAULT] 
    

    at the following callstack:

    D3D12RaytracingMiniEngineSample.exe!PostEffects::Render() Line 511	C++
    D3D12RaytracingMiniEngineSample.exe!GameCore::UpdateApplication(GameCore::IGameApp & game) Line 77	C++
    D3D12RaytracingMiniEngineSample.exe!GameCore::RunApplication(GameCore::IGameApp & app, const wchar_t * className) Line 356	C++
    D3D12RaytracingMiniEngineSample.exe!wmain(int argc, wchar_t * * argv) Line 278	C++
    

    Even after commenting out all code within the PostEffects::Render() function (other than context.begin() and context.finish()) the crash still occurs. With the d3d debug layer enabled I get the following output

    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 1 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 2 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 3 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 4 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 5 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 6 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 7 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 8 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    D3D12 ERROR: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (ptr = 0x13a79035420 at 9 offsetInDescriptorsFromDescriptorHeapStart) of type SRV, for Root Signature (0x0000013A0A687230:'Unnamed ID3D12RootSignature Object')'s Descriptor Table (at Parameter Index [4])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_UAV) have mismatching types. All descriptors of descriptor ranges declared STATIC (not-DESCRIPTORS_VOLATILE) in a root signature must be initialized prior to being set on the command list. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
    

    at

    	D3D12RaytracingMiniEngineSample.exe!D3D12RaytracingMiniEngineSample::RaytraceDiffuse(GraphicsContext & context, const Math::Camera & camera, ColorBuffer & colorTarget) Line 1588	C++
     	D3D12RaytracingMiniEngineSample.exe!D3D12RaytracingMiniEngineSample::Raytrace(GraphicsContext & gfxContext) Line 1692	C++
     	D3D12RaytracingMiniEngineSample.exe!D3D12RaytracingMiniEngineSample::RenderScene() Line 1396	C++
     	D3D12RaytracingMiniEngineSample.exe!GameCore::UpdateApplication(GameCore::IGameApp & game) Line 75	C++
     	D3D12RaytracingMiniEngineSample.exe!GameCore::RunApplication(GameCore::IGameApp & app, const wchar_t * className) Line 356	C++
     	D3D12RaytracingMiniEngineSample.exe!wmain(int argc, wchar_t * * argv) Line 278	C++
    

    I'm not sure if any of this is helpful, but I'm running this on a GTX1050 on 411.70 drivers. For what it's worth all of the other samples in this solution work as expected.

  • D3D12 WARNING crashes graphics debugging

    D3D12 WARNING crashes graphics debugging

    D3D12 WARNING: ID3D12Resource::ID3D12Resource::Map: pReadRange is NULL and the heap page property is WRITE_BACK. This can be an indicator of inefficiencies that will result on mobile systems, as the range should be as tight as possible. But, it is also possible the range must encompass the whole subresource.A NULL pReadRange parameter indicates all resource memory will be read by the CPU.  [ EXECUTION WARNING #930: MAP_INVALID_NULLRANGE]
    
    D3D12 WARNING: ID3D12Resource::ID3D12Resource::Unmap: pWrittenRange is NULL and the heap page property is WRITE_BACK. This can be an indicator of inefficiencies that will result on mobile systems, as the range should be as tight as possible. But, it is also possible the range must encompass the whole subresource.A NULL pWrittenRange parameter indicates all resource memory was written to.  [ EXECUTION WARNING #931: UNMAP_INVALID_NULLRANGE]
    

    I am trying to execute two command lists at once to see if gpu cores, and heaps are being used properly and I can't debug it because this pops up and crashes the debugger. When I execute without graphics debugger everything works perfectly, both command lists are rendering their draw commands and everything looks fine. untitled

  • Question about strictness of resource states

    Question about strictness of resource states

    Dear Microsoft Team,

    I attached two files, which contain a modified version of the HelloTexture sample.

    The major change is, that I create an unordered access view to the texture in addition to the shader resource view in the LoadAssets method of the sample:

    D3D12_UNORDERED_ACCESS_VIEW_DESC uavDesc = {};
    uavDesc.Format = textureDesc.Format;
    uavDesc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2D;
    uavDesc.Texture2D.MipSlice = 0;
    uavDesc.Texture2D.PlaneSlice = 0;
    
    handle.ptr += m_srvDescriptorSize;
    
    m_device->CreateUnorderedAccessView(m_texture.Get(), nullptr, &uavDesc, handle);
    

    Also I change the resource state of the texture from COPY_DEST to UNORDERED_ACCESS instead to PIXEL_SHADER_RESOURCE:

    m_commandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_texture.Get(), D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_UNORDERED_ACCESS));
    

    I did not change anything in the rendering method, so the texture is still used there as a pixel shader resource. Now my question: Why is this working? Why can the texture be used as a pixel shader resource so its resource state is UNORDERED_ACCESS?

    Is it because UNORDERED_ACCESS is a read/write state and the set read flag automatically includes read-only states? On the other hand, changing the state to or-combined UNORDERED_ACCESS | PIXEL_SHADER_RESOURCE is not allowed, cause read/write states cannot or-combined with read-only states. So to be honest, I am a bit confused.

    I did not find an option in the Visual Studio Graphics Debugger (and neither in NSight) to check the current state of a resource. Did I have overseen something?

    Kind regards,

    Joerg Sahm

    D3D12HelloTexture.zip

  • DXC Erroring in RealTimeDenoisedAmbientOcclusion Sample

    DXC Erroring in RealTimeDenoisedAmbientOcclusion Sample

    I have been trying to compile the example stated in the title, however DXC keeps erroring out with pretty much no debug information on compile - all other samples work fine.

    1>dxc failed : cannot specify entry point for a library
    1>E:\Visual Studio 2019\IDE\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1532,5): error MSB6006: "dxc.exe" exited with code 1.
    1>Done building project "D3D12RaytracingRealTimeDenoisedAmbientOcclusion.vcxproj" -- FAILED.
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    

    It seems that there is a library with an invalid entry point somewhere, but I have absolutely no clue where. Is there any further debugging for DXC or is there a shader error somewhere ?

  • MiniEngine: CommandListManager::m_CommandQueue is null

    MiniEngine: CommandListManager::m_CommandQueue is null

    In line 78, CommandListManager::m_CommandQueue is NULL when running the Debug and Profile builds. This bug is found in CommandQueue::Create of CommandListManager.cpp, part of the Core library. Does not trigger when running Release configuration.

    Fix: Commenting out line 100 pDevice->SetStablePowerState(TRUE); seems to fix this bug. Forcing low GPU clocks seems to put the hardware in a state that fails creation of the CommandQueue.

    My system is NVIDIA Geforce 1070, Intel i6500K

  • VSGD frame capture with Placed resource in an UPLOAD heap will not open

    VSGD frame capture with Placed resource in an UPLOAD heap will not open

    Capturing a frame that renders a single triangle (Based on the HelloTriangle) sample crashes the graphics debugging tools with or without the debug SDK layer enabled. To reproduce, open the attached diag session in crashing frame.zip and double click the single captured frame. Output from dxcap -info also attached. Let me know if you need more information.

    crashing frame.zip

    dxcap_info.txt

  • Win32 vs UWP

    Win32 vs UWP

    I wasn't sure where else to ask this so feel free to remove if this isn't the appropriate place. I noticed the samples are all using Win32 instead of the new UWP API's. Is that the recommended approach of making DX12 applications? Or was it just an arbitrary decision for the samples?

  • DX12+XAML for UWP template

    DX12+XAML for UWP template

    I brought this up the other day in a closed thread, so I am creating a new one. Feel free to tell me to close this one if needed.

    Has there been any update on the DX12+XAML for UWP template? I am currently developing a C#/C++ Direct2D application and have run into an issue creating my SwapChainPanel.

  • MiniEngine crashes on compile

    MiniEngine crashes on compile

    Compiler crashes when building MiniEngine (VS2015Update1 default cmplr.).

    "1> GraphicsCore.cpp 1> Generating Code... 1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0(909): fatal error C1001: An internal error has occurred in the compiler. 1> (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 246) 1> To work around this problem, try simplifying or changing the program near the locations listed above. 1> Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information 1> CL!InvokeCompilerPass()+0x2d4bd 1> CL!DllGetC2Telemetry()+0xae663 1> "

  • Solution files for samples appear corrupted in VS2022

    Solution files for samples appear corrupted in VS2022

    Attempting to open the .sln file for any of the desktop samples in VS2022 produces: image

    Applying this diff is enough to get them to work:

    --- a/Samples/Desktop/D3D12HelloWorld/src/D3D12HelloWorld.sln
    +++ b/Samples/Desktop/D3D12HelloWorld/src/D3D12HelloWorld.sln
    @@ -1,8 +1,6 @@
     
     Microsoft Visual Studio Solution File, Format Version 12.00
     # Visual Studio Version 16
    -VisualStudioVersion = 16.0.30621.155.26403.0
    -MinimumVisualStudioVersion = 10.0.40219.1
     Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3D12HelloTriangle", "HelloTriangle\D3D12HelloTriangle.vcxproj", "{5018F6A3-6533-4744-B1FD-727D199FD2E9}"
     EndProject
     Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3D12HelloBundles", "HelloBundles\D3D12HelloBundles.vcxproj", "{CAE2B6C4-B644-4B92-8804-23E18310765B}"
    
  • vs2022 compilation failure

    vs2022 compilation failure

    1>ForwardPlusLighting.obj : error LNK2019: 无法解析的外部符号 "unsigned __int64 __cdecl Graphics::GetFrameCount(void)" ([email protected]@@YA_KXZ),函数 "void __cdecl Lighting::FillLightGrid(class GraphicsContext &,class Math::Camera const &)" ([email protected]@@[email protected]@[email protected]@@@Z) 中引用了该符号 1>Core.lib(EngineProfiling.obj) : error LNK2001: 无法解析的外部符号 "unsigned __int64 __cdecl Graphics::GetFrameCount(void)" ([email protected]@@YA_KXZ) 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "bool __cdecl CommandLineArgs::GetInteger(wchar_t const *,unsigned int &)" ([email protected]@@[email protected]),函数 "public: virtual void __cdecl ModelViewer::Startup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>Core.lib(GraphicsCore.obj) : error LNK2001: 无法解析的外部符号 "bool __cdecl CommandLineArgs::GetInteger(wchar_t const *,unsigned int &)" ([email protected]@@[email protected]) 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "bool __cdecl CommandLineArgs::GetString(wchar_t const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)" ([email protected]@@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@@Z),函数 "public: virtual void __cdecl ModelViewer::Startup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>Core.lib(GraphicsCore.obj) : error LNK2001: 无法解析的外部符号 "bool __cdecl CommandLineArgs::GetString(wchar_t const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)" ([email protected]@@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@@Z) 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Sponza::Startup(class Math::Camera &)" ([email protected]@@[email protected]@@@Z),函数 "public: virtual void __cdecl ModelViewer::Startup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Sponza::Cleanup(void)" ([email protected]@@YAXXZ),函数 "public: virtual void __cdecl ModelViewer::Cleanup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Sponza::RenderScene(class GraphicsContext &,class Math::Camera const &,struct D3D12_VIEWPORT const &,struct tagRECT const &,bool,bool)" ([email protected]@@[email protected]@[email protected]@@[email protected]@[email protected]@[email protected]),函数 "public: virtual void __cdecl ModelViewer::RenderScene(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Renderer::Initialize(void)" ([email protected]@@YAXXZ),函数 "public: virtual void __cdecl ModelViewer::Startup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Renderer::Shutdown(void)" ([email protected]@@YAXXZ),函数 "public: virtual void __cdecl ModelViewer::Cleanup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Renderer::SetIBLTextures(class TextureRef,class TextureRef)" ([email protected]@@[email protected]@[email protected]),函数 "void __cdecl ChangeIBLSet(enum EngineVar::ActionType)" ([email protected]@[email protected]@@@Z) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Renderer::SetIBLBias(float)" ([email protected]@@[email protected]),函数 "void __cdecl ChangeIBLBias(enum EngineVar::ActionType)" ([email protected]@[email protected]@@@Z) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Renderer::DrawSkybox(class GraphicsContext &,class Math::Camera const &,struct D3D12_VIEWPORT const &,struct tagRECT const &)" ([email protected]@@[email protected]@[email protected]@@[email protected]@[email protected]@@Z),函数 "public: virtual void __cdecl ModelViewer::RenderScene(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl Renderer::MeshSorter::Sort(void)" ([email protected]@[email protected]@QEAAXXZ),函数 "public: virtual void __cdecl ModelViewer::RenderScene(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl Renderer::MeshSorter::RenderMeshes(enum Renderer::MeshSorter::DrawPass,class GraphicsContext &,struct GlobalConstants &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z),函数 "public: virtual void __cdecl ModelViewer::RenderScene(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl ModelInstance::LoopAllAnimations(void)" ([email protected]@@QEAAXXZ),函数 "public: virtual void __cdecl ModelViewer::Startup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "class std::shared_ptr __cdecl Renderer::LoadModel(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,bool)" ([email protected]@@[email protected]@@@[email protected]@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected][email protected]),函数 "public: virtual void __cdecl ModelViewer::Startup(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>ModelViewer.obj : error LNK2019: 无法解析的外部符号 "float __cdecl Graphics::GetFrameTime(void)" ([email protected]@@YAMXZ),函数 "public: virtual void __cdecl ModelViewer::RenderScene(void)" ([email protected]@@UEAAXXZ) 中引用了该符号 1>Core.lib(GameCore.obj) : error LNK2001: 无法解析的外部符号 "float __cdecl Graphics::GetFrameTime(void)" ([email protected]@@YAMXZ) 1>ModelViewer.obj : error LNK2001: 无法解析的外部符号 "class EnumVar Graphics::DebugZoom" ([email protected]@@[email protected]@A) 1>Core.lib(CameraController.obj) : error LNK2001: 无法解析的外部符号 "class EnumVar Graphics::DebugZoom" ([email protected]@@[email protected]@A) 1>Core.lib(EngineTuning.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayWidth" ([email protected]@@3IA) 1>Core.lib(EngineProfiling.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayWidth" ([email protected]@@3IA) 1>Core.lib(BufferManager.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayWidth" ([email protected]@@3IA) 1>Core.lib(GameCore.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayWidth" ([email protected]@@3IA) 1>Core.lib(EngineTuning.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayHeight" ([email protected]@@3IA) 1>Core.lib(EngineProfiling.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayHeight" ([email protected]@@3IA) 1>Core.lib(BufferManager.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayHeight" ([email protected]@@3IA) 1>Core.lib(GameCore.obj) : error LNK2001: 无法解析的外部符号 "unsigned int Graphics::g_DisplayHeight" ([email protected]@@3IA) 1>Core.lib(GameCore.obj) : error LNK2019: 无法解析的外部符号 "void __cdecl CommandLineArgs::Initialize(int,wchar_t * *)" ([email protected]@@[email protected]),函数 "void __cdecl GameCore::InitializeApplication(class GameCore::IGameApp &)" ([email protected]@@[email protected]@@Z) 中引用了该符号 1>Core.lib(GameCore.obj) : error LNK2019: 无法解析的外部符号 "void __cdecl Display::Resize(unsigned int,unsigned int)" ([email protected]@@[email protected]),函数 "__int64 cdecl GameCore::WndProc(struct HWND *,unsigned int,unsigned __int64,int64)" ([email protected]@@YA_JPEAUHWND@@[email protected]) 中引用了该符号 1>Core.lib(GameCore.obj) : error LNK2019: 无法解析的外部符号 "void __cdecl Display::Present(void)" ([email protected]@@YAXXZ),函数 "bool __cdecl GameCore::UpdateApplication(class GameCore::IGameApp &)" ([email protected]@@[email protected]@@Z) 中引用了该符号 1>Core.lib(PostEffects.obj) : error LNK2001: 无法解析的外部符号 "bool Graphics::g_bEnableHDROutput" ([email protected]@@3_NA) 1>Core.lib(PostEffects.obj) : error LNK2001: 无法解析的外部符号 "class NumVar Graphics::g_HDRPaperWhite" ([email protected]@@[email protected]@A) 1>Core.lib(PostEffects.obj) : error LNK2001: 无法解析的外部符号 "class NumVar Graphics::g_MaxDisplayLuminance" ([email protected]@@[email protected]@A) 1>Core.lib(TextRenderer.obj) : error LNK2019: 无法解析的外部符号 "public: void __cdecl Texture::Create2D(unsigned __int64,unsigned __int64,unsigned __int64,enum DXGI_FORMAT,void const *)" ([email protected]@@[email protected]@[email protected]),函数 "public: void __cdecl TextRenderer::Font::LoadFromBinary(wchar_t const *,unsigned char const *,unsigned __int64)" ([email protected]@[email protected]@[email protected]) 中引用了该符号 1>Core.lib(GraphicsCommon.obj) : error LNK2001: 无法解析的外部符号 "public: void __cdecl Texture::Create2D(unsigned __int64,unsigned __int64,unsigned __int64,enum DXGI_FORMAT,void const *)" ([email protected]@@[email protected]@[email protected]) 1>Core.lib(GraphicsCore.obj) : error LNK2019: 无法解析的外部符号 CreateDXGIFactory2,函数 "void __cdecl Graphics::Initialize(bool)" ([email protected]@@[email protected]) 中引用了该符号 1>Core.lib(GraphicsCore.obj) : error LNK2019: 无法解析的外部符号 DXGIGetDebugInterface1,函数 "void __cdecl Graphics::Initialize(bool)" ([email protected]@@[email protected]) 中引用了该符号 1>Core.lib(GraphicsCore.obj) : error LNK2019: 无法解析的外部符号 "void __cdecl Display::Initialize(void)" ([email protected]@@YAXXZ),函数 "void __cdecl Graphics::Initialize(bool)" ([email protected]@@[email protected]) 中引用了该符号 1>Core.lib(GraphicsCore.obj) : error LNK2019: 无法解析的外部符号 "void __cdecl Display::Shutdown(void)" ([email protected]@@YAXXZ),函数 "void __cdecl Graphics::Shutdown(void)" ([email protected]@@YAXXZ) 中引用了该符号 1>Core.lib(GraphicsCommon.obj) : error LNK2019: 无法解析的外部符号 "public: void __cdecl Texture::CreateCube(unsigned __int64,unsigned __int64,unsigned __int64,enum DXGI_FORMAT,void const *)" ([email protected]@@[email protected]@[email protected]),函数 "void __cdecl Graphics::InitializeCommonState(void)" ([email protected]@@YAXXZ) 中引用了该符号 1>Model.lib(Model.obj) : error LNK2019: 无法解析的外部符号 "public: void __cdecl UploadBuffer::Create(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,unsigned __int64)" ([email protected]@@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@[email protected]),函数 "public: __cdecl ModelInstance::ModelInstance(class std::shared_ptr)" ([email protected]@[email protected][email protected][email protected]@@[email protected]@@Z) 中引用了该符号 1>Model.lib(Model.obj) : error LNK2019: 无法解析的外部符号 "public: void * __cdecl UploadBuffer::Map(void)" ([email protected]@@QEAAPEAXXZ),函数 "public: void __cdecl ModelInstance::Update(class GraphicsContext &,float)" ([email protected]@@[email protected]@[email protected]) 中引用了该符号 1>Model.lib(Model.obj) : error LNK2019: 无法解析的外部符号 "public: void __cdecl UploadBuffer::Unmap(unsigned __int64,unsigned __int64)" ([email protected]@@[email protected]),函数 "public: void __cdecl ModelInstance::Update(class GraphicsContext &,float)" ([email protected]@@[email protected]@[email protected]) 中引用了该符号 1>Model.lib(Model.obj) : error LNK2019: 无法解析的外部符号 "public: void __cdecl ModelInstance::UpdateAnimations(float)" ([email protected]@@[email protected]),函数 "public: void __cdecl ModelInstance::Update(class GraphicsContext &,float)" ([email protected]@@[email protected]@[email protected]) 中引用了该符号 1>Model.lib(Model.obj) : error LNK2019: 无法解析的外部符号 "public: void __cdecl Renderer::MeshSorter::AddMesh(struct Mesh const &,float,unsigned __int64,unsigned __int64,unsigned __int64,struct Joint const *)" ([email protected]@[email protected]@[email protected]@[email protected]@@Z),函数 "public: void __cdecl Model::Render(class Renderer::MeshSorter &,class GpuBuffer const &,class Math::ScaleAndTranslation const * const,struct Joint const *)const " ([email protected]@@[email protected]@@[email protected]@[email protected]@@[email protected]@@Z) 中引用了该符号 1>MSVCRTD.lib(exe_main.obj) : error LNK2019: 无法解析的外部符号 main,函数 "int __cdecl invoke_main(void)" ([email protected]@YAHXZ) 中引用了该符号

  • D3D12nBodyGravity debug layer error

    D3D12nBodyGravity debug layer error

    Opened the D3D12nBodyGravity project in VS and ran with F5 and saw this error in output window:

    D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: Resource(0x000002AFEFEED460:'m_particleBuffer0[0]') (subresource : 0) was bound as DATA_STATIC on Command List 0x000002AFEB7B5C70:'m_commandList', still in execution (ExecuteCommandLists) by Command Queue 0x000002AFEB6BA200:'m_commandQueue'. It is invalid to change it until the command list has finished executing for the last time, but there is a state transition to (0x40: D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE) here, which indicates a change to its data (or possibly resource metadata). [ EXECUTION ERROR #1002: DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE]

  • Viewport corruption with AMD Radeon on window resize

    Viewport corruption with AMD Radeon on window resize

    1. load https://github.com/microsoft/DirectX-Graphics-Samples/tree/master/Samples/Desktop/D3D12HelloWorld/src/HelloTriangle

    2. modify https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/Samples/Desktop/D3D12HelloWorld/src/HelloTriangle/D3D12HelloTriangle.cpp#L201 with the following code

            // Define the geometry for a triangle.
            Vertex triangleVertices[] =
            {
                { { 0.0f, 1.f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f, 0.0f, 1.0f } },
                { { 1.f, -1.f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f, 0.0f, 1.0f } },
                { { -1.f, -1.f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } }
            };
    

    This will make the bug visible as the triangle will now extend to the window extents.

    1. run app and resize the window a bit using the mouse (ex. bottom right corner)

    2. see corruption in the viewport as it seems mismatched to the window client area image

    3. moving the window with the title bar will fix the bug

    DxDiag.txt

  • Sporadic crashes in MiniEngine caused by bug in code

    Sporadic crashes in MiniEngine caused by bug in code

    The D3D12RaytracingMiniEngineSample project sporadically crashes from time to time. This is caused by a bug in the code in ModelViewer.cpp, function InitializeRaytracingStateObjects():

    D3D12_STATE_SUBOBJECT &rayGenDxilLibSubobject = subObjects.back();
    ...
    rayGenDxilLibSubobject = CreateDxilLibrary(rayGenShaderExportName, g_pRayGenerationShaderLib, sizeof(g_pRayGenerationShaderLib), rayGenDxilLibDesc, rayGenExportDesc);
    ...
    D3D12_STATE_SUBOBJECT hitGroupLibSubobject = CreateDxilLibrary(closestHitExportName, g_phitShaderLib, sizeof(g_phitShaderLib), hitGroupDxilLibDesc, hitGroupExportDesc);
    subObjects.push_back(hitGroupLibSubobject);
    ...
    rayGenDxilLibSubobject = CreateDxilLibrary(rayGenShaderExportName, g_pRayGenerationShaderSSRLib, sizeof(g_pRayGenerationShaderSSRLib), rayGenDxilLibDesc, rayGenExportDesc);
    

    The problem is that the code saves a reference to an element in a vector, but the vector is resized and the reference is no longer valid, and the assignment later on can crash the app.

The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) programs into DirectX Intermediate Language (DXIL) representation

DirectX Shader Compiler The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) pr

Aug 7, 2022
✖🌱 A DirectX 12 starter repo that you could use to get the ball rolling.
✖🌱 A DirectX 12 starter repo that you could use to get the ball rolling.

DirectX 12 Seed A DirectX 12 repo you can use to get started with your own renderer. Setup First install: Git CMake Visual Studio Then type the follow

Jul 28, 2022
Playground for DirectX 11 / 12 simple graphics demo examples ...

graphicsdemoskeleton Playground for DirectX 11 / 12 simple graphics demo examples ... If anyone from Microsoft reads this: C99 support is broken in Di

Jan 13, 2022
A C++/DirectX 11 implementation of "A Scalable and Production Ready Sky and Atmosphere Rendering Technique"
A C++/DirectX 11 implementation of

Atmosphere Renderer A C++/DirectX 11 implementation of "A Scalable and Production Ready Sky and Atmosphere Rendering Technique" Features interactive e

Aug 2, 2022
A real-time DirectX 11 renderer. The renderer is named by my girlfriend's english name.
A real-time DirectX 11 renderer. The renderer is named by my girlfriend's english name.

sophia Sophia is a real-time DirectX 11 renderer. It is not quite a rich graphics engine, only packages some low-level DirectX functions and contains

Dec 11, 2021
DirectX 11 and 12 library that provides a scalable and GCN-optimized solution for deferred shadow filtering

AMD ShadowFX The ShadowFX library provides a scalable and GCN-optimized solution for deferred shadow filtering. Currently the library supports uniform

Jul 13, 2022
DirectX shader bytecode cross compiler

HLSLcc DirectX shader bytecode cross compiler. Originally based on https://github.com/James-Jones/HLSLCrossCompiler. This library takes DirectX byteco

Aug 4, 2022
This repo will sort of document my story of learning vulkan with VulkanSDK and cl (msvc) on windows.
This repo will sort of document my story of learning vulkan with VulkanSDK and cl (msvc) on windows.

Learning Vulkan This repo is a means of documenting my journey with learning Vulkan's basics on windows. Because of the binaries in the LunarG VulkanS

Dec 8, 2021
Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal

Low Level Graphics Library (LLGL) Documentation NOTE: This repository receives bug fixes only, but no major updates. Pull requests may still be accept

Aug 13, 2022
A terminal-based graphics library for both 2D and 3D graphics.
A terminal-based graphics library for both 2D and 3D graphics.

TermGL A terminal-based graphics library for both 2D and 3D graphics. Written in C, created for terminals supporting ANSI escape codes. Table of Conte

Aug 10, 2022
kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics

kaun kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics. It is a Lua module you can require from a shared library

Apr 5, 2021
Modern C++14 library for the development of real-time graphical applications

CI Community Support bs::framework is a C++ library that aims to provide a unified foundation for the development of real-time graphical applications,

Aug 7, 2022
Orbit is a multiplatform-focus graphical engine build on top of OpenGl, ImGui
Orbit is a multiplatform-focus graphical engine build on top of OpenGl, ImGui

Orbit Engine Orbit is a multiplatform-focus graphical engine build on top of OpenGl, ImGui and more... The development of the engine is documented via

Jul 3, 2021
StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR!
StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR!

StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR! Inspired by libraries like XNA and Processing, StereoKit is meant to be fun to use and easy to develop with, yet still quite capable of creating professional and business ready software.

Aug 8, 2022
A minimalist library with basic facilities for developing interactive real-time 3D applications, with a strong emphasis on simplicity and ease of use.
A minimalist library with basic facilities for developing interactive real-time 3D applications, with a strong emphasis on simplicity and ease of use.

SlimEngine A minimalist and platform-agnostic base project for interactive graphical applications (2D/3D) with a strong emphasis on simplicity, ease o

Jul 27, 2022
A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.
A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.

A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.

Aug 17, 2022
Build-once run-anywhere OpenGL application

Build-once run-anywhere OpenGL application Standing on the shoulders of Cosmopolitan libc this proof of concept application should run on Windows and

Jul 16, 2022
SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications.

SPIRV-Reflect SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications. SPIRV-Ref

Aug 7, 2022
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Cross-platform, graphics API agnostic,

bgfx - Cross-platform rendering library GitHub Discussions Discord Chat What is it? Cross-platform, graphics API agnostic, "Bring Your Own Engine/Fram

Aug 14, 2022