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

Overview

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

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.

    miniengine 
    opened by NicoM1 26
  • 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?

    question 
    opened by sherief 19
  • 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.

    miniengine 
    opened by mt93 18
  • 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 tools 
    opened by cpyburn 18
  • 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

    question 
    opened by Yoshusa 18
  • 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 ?

    question 
    opened by Nolram12345 17
  • 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

    bug miniengine 
    opened by nirajvenkat 16
  • 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

    bug tools 
    opened by sherief 16
  • 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?

    question 
    opened by chadmv 16
  • 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.

    enhancement samples 
    opened by thecobblersfather 14
  • 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> "

    question miniengine 
    opened by tjukic 14
  • I cannot download that DirectX-Graphics-Samples

    I cannot download that DirectX-Graphics-Samples

    Failed normal Download ZIP

    When I click the [<> Code] button and "Download ZIP", then I got a corrupted file (Windows cannot open the folder). Note that I repeated the same process so many times since many months ago because DirectX 12 is very important, but still failed. I tried 7-Zip to force extract but there are a lot of missing files then. zip

    Failed when using git clone

    The latest percentage I remember stuck on 27% (500 MB+), because it's too slow, not normal, but when I came back then it's suddenly 100% (failed). The reason I download from Linux is the normal Download ZIP from Windows didn't work, and I was hoping that it will work on Linux but it doesn't work. linux

    Questions

    Is it possible to fix that problem? Should the administrator reupload the DirectX Samples? Or should I wait for the release of DirectX 13 because it's impossible to learn DirectX 12?

    I asked the question in this link but a community expert said that the issue is more related to GitHub and my machine: https://learn.microsoft.com/en-us/answers/questions/1112283/how-to-use-the-d3d12-raytracing-fallback-layer.html

    question 
    opened by mandaxyzw 3
  • WaitForGpu() method in D3D12nBodyGravity sample

    WaitForGpu() method in D3D12nBodyGravity sample

    I might be wrong but it seems like the m_renderContextFenceValues array is not indexed correctly in the WaitForGpu() function. m_renderContextFenceValues is an array of size ThreadCount but it is indexed using frame-index which might lead to access violation. I couldn't reproduce the issue as the WaitForGpu is only called when DXGI_ERROR_DEVICE_REMOVED or DXGI_ERROR_DEVICE_RESET but I thought it might worth someone double checking it.

    samples 
    opened by omd24 0
  • Disambiguate UpdateTileMappings function usage

    Disambiguate UpdateTileMappings function usage

    • According to official docs(https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12commandqueue-updatetilemappings?redirectedfrom=MSDN), UpdateTileMappings is only taking a pointer to a single heap(allowing multiple offsets into this heap, but not multiple heaps). The sample is iterating over multiple heaps and tries to map tiles to them in a single UpdateTileMappings call. While this doesn't break the functionality of the sample, in a real world applications with more complicated heap usage patterns, this wouldn't work.
    opened by hadalhw17 2
  • Crash when launching D3D12RaytracingProceduralGeometry

    Crash when launching D3D12RaytracingProceduralGeometry

    Unhandled exception at 0x00007FFAABD706BC (KernelBase.dll) in D3D12RaytracingProceduralGeometry.exe: 0xC000041D

    Callstack:

    • KernelBase.dll!00007ffaabd706bc() Unknown
    • DXGIDebug.dll!00007ffa5cbd3059() Unknown
    • d3d12SDKLayers.dll!00007ffa49c57731() Unknown
    • d3d12SDKLayers.dll!00007ffa49b745ea() Unknown
    • d3d12SDKLayers.dll!00007ffa49b744a3() Unknown
    • d3d12SDKLayers.dll!00007ffa49be499e() Unknown
    • d3d12SDKLayers.dll!00007ffa49be00c1() Unknown
    • D3D12RaytracingProceduralGeometry.exe!DX::DeviceResources::ExecuteCommandList() Line 556 C++
    • D3D12RaytracingProceduralGeometry.exe!DX::DeviceResources::Present(D3D12_RESOURCE_STATES beforeState) Line 518 C++
    • D3D12RaytracingProceduralGeometry.exe!D3D12RaytracingProceduralGeometry::OnRender() Line 1297 C++
    • D3D12RaytracingProceduralGeometry.exe!Win32Application::WindowProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 232 C++
    • [External Code]
    • D3D12RaytracingProceduralGeometry.exe!Win32Application::Run(DXSample * pSample, HINSTANCE__ * hInstance, int nCmdShow) Line 73 C++
    • D3D12RaytracingProceduralGeometry.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, char * __formal, int nCmdShow) Line 19 C++
    • [External Code]

    Windows 11 25206.1000 nVidia GeForce RTX 3070 (31.0.15.3004)

    bug samples 
    opened by GolubovCsabaAntalOTP 0
  • [Direct3D 12 HDR sample] Metadata not forwarded in windowed mode

    [Direct3D 12 HDR sample] Metadata not forwarded in windowed mode

    I just got a question regarding the Direct3D 12 HDR sample app. Actual metadata is only transmitted when the app is in fullscreen. I confirmed this with a hdfury arcana that shows the HDMI stream information. Is this behavior intended, where metadata is only forwarded in fullscreen mode, or is this a bug? Or to ask it differently what is needed for the windows compositor to actually forward HDR metadata?

    This behavior is also present in other apps, like the video player mpv, that rely on the same api calls (like IDXGISwapChain4_SetHDRMetaData). The mpv video player transmits metadata only in fullscreen mode, like the HDR samples app.

    (tested on Windows 10 21H2, with a RTX3050 and a RX 580)

    question 
    opened by mitzsch 1
  • HDR Sample treating Min/MaxMasteringLuminance as the same range?

    HDR Sample treating Min/MaxMasteringLuminance as the same range?

    Hello!

    I was looking at the HDR sample here: https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/Samples/Desktop/D3D12HDR/src/D3D12HDR.cpp#L994

    And it seems to treat MaxMasteringLuminance and MinMasteringLuminance as the same range/scale.

    Whereas the docs say:

    MaxMasteringLuminance
    
    The maximum number of nits of the display used to master the content. Values are in whole nits.
    
    MinMasteringLuminance
    
    The minimum number of nits of the display used to master the content. Values are 1/10000th of a nit (0.0001 nit).
    

    Is the sample wrong, are the docs wrong, or am I just misunderstanding?

    Thanks for your time!

    bug samples 
    opened by Joshua-Ashton 4
Releases(MicrosoftDocs-Samples)
Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
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

Microsoft 2.4k Jan 3, 2023
✖🌱 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

Alain Galvan 74 Dec 6, 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

Wolfgang Engel 44 Dec 10, 2022
A C++/DirectX 11 implementation of "A Scalable and Production Ready Sky and Atmosphere Rendering Technique"

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

Z Guan 37 Nov 20, 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

Unity Technologies 742 Dec 29, 2022
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

GPUOpen Effects 163 Dec 9, 2022
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

BB 6 Dec 11, 2021
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

null 2 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) Documentation NOTE: This repository receives bug fixes only, but no major updates. Pull requests may still be accept

Lukas Hermanns 1.5k Jan 8, 2023
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

null 215 Dec 28, 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

Joel Schumacher 4 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,

null 1.7k Jan 2, 2023
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

Madsycode 11 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! 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.

Nick Klingensmith 730 Jan 4, 2023
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

Arnon Marcus 67 Oct 29, 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.

null 2.5k Jan 4, 2023
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

null 62 Dec 22, 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

The Khronos Group 457 Dec 26, 2022
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

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

Бранимир Караџић 12.6k Jan 8, 2023