DirectX-Graphics-Samples | This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive app | Graphics library
kandi X-RAY | DirectX-Graphics-Samples Summary
kandi X-RAY | DirectX-Graphics-Samples Summary
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DirectX-Graphics-Samples
DirectX-Graphics-Samples Key Features
DirectX-Graphics-Samples Examples and Code Snippets
Community Discussions
Trending Discussions on DirectX-Graphics-Samples
QUESTION
Microsoft documentation and sample code claims that DXGI can switch a monitor between HDR/SDR modes. However running the code sample D3D12HDR and changing the swap chain format does not change the monitor mode for me.
I am only able to set the screen into hdr either through:
- windows display settings, "Play HDR games and apps" toggle switch
- nvidia api functions
Is it possible to change the monitor's HDR mode using only DXGI API? My monitor is an ASUS XG27U.
...ANSWER
Answered 2021-Aug-07 at 17:48There are no DX APIs to set the display into HDR mode. It must be enabled in Windows display settings.
Use of the NVIDIA API functions is discouraged.
QUESTION
I have experience with D3D11 and want to learn D3D12. I am reading the official D3D12 multithread example and don't understand why the shadow map (generated in the first pass as a DSV, consumed in the second pass as SRV) is created for each frame (actually only 2 copies, as the FrameResource
is reused every 2 frames).
The code that creates the shadow map resource is here, in the FrameResource
class, instances of which is created here.
There is actually another resource that is created for each frame, the constant buffer. I kind of understand the constant buffer. Because it is written by CPU (D3D11 dynamic usage) and need to remain unchanged until the GPU finish using it, so there need to be 2 copies. However, I don't understand why the shadow map needs to do the same, because it is only modified by GPU (D3D11 default usage), and there are fence commands to separate reading and writing to that texture anyway. As long as the GPU follows the fence, a single texture should be enough for the GPU to work correctly. Where am I wrong?
Thanks in advance.
EDIT
According to the comment below, the "fence" I mentioned above should more accurately be called "resource barrier".
...ANSWER
Answered 2021-Jun-19 at 00:10The key issue is that you don't want to stall the GPU for best performance. Double-buffering is a minimal requirement, but typically triple-buffering is better for smoothing out frame-to-frame rendering spikes, etc.
FWIW, the default behavior of DXGI Present
is to stall only after you have submitted THREE frames of work, not two.
Of course, there's a trade-off between triple-buffering and input responsiveness, but if you are maintaining 60 Hz or better than it's likely not noticeable.
With all that said, typically you don't need to double-buffered depth/stencil buffers for rendering, although if you wanted to make the initial write of the depth-buffer overlap with the read of the previous depth-buffer passes then you would want distinct buffers per frame for performance and correctness.
The 'writes' are all complete before the 'reads' in DX12 because of the injection of the 'Resource Barrier' into the command-list:
QUESTION
I've encountered NuGet problems while building DirectX-Graphics-Samples
The error occurs with many projects, here is an example:
...ANSWER
Answered 2021-May-05 at 01:29QUESTION
So, I created a project and copied this tutorial in it. When I tried to run it, it gave me this error: C2102 & requires l-value
at
ANSWER
Answered 2020-Dec-16 at 00:06This is essentially the same build error reported under Issue #652 Error building D3D12MeshShaders (on VS 16.8.0 Preview 3.0) in the DirectX-Graphics-Samples repo.
I'm getting error C2102: '&' requires l-value on many of the lines. Usually it's when a CD3DX12 constructor is directly used with an &, for example [...]
The issue is still open, with an interim workaround given in a comment:
The use of an address of an r-value like this [...] is non-conforming code.
Visual C++ emits a warning C4238 here with /W4 warning level 4, but most VC projects default to level 3 including these samples. [...] Looks like the latest Visual C++ updates for /permissive- have upgraded this to an error.
You can work around this issue for now by disabling /permissive- by changing "Conformance Mode" to "No" in the C/C++ -> Language project settings.
QUESTION
I'm trying to learn DirectX 12 and i found out these tutorials on github. I downloaded everything and i tried to run the HelloWindow project. I linked the d3d12.lib in Debug->Options->Linker->Input. Unfortunately, it gives me a bunch of errors from d3dx12.h. For most of them, Intellisense says to include d3d12.h even if i already did it. For example, D3D12_RESOURCE_DESC1 is undefined and all his attributes too etc. Did i missed something if yes pls help me.
...ANSWER
Answered 2020-Dec-14 at 20:20You are using the 'latest' copy of D3DX12.H
which requires you use the 'latest' version of the Windows 10 SDK (19041). If D3D12_RESOURCE_DESC1
is undefined, you are using an older Windows 10 SDK.
Note that there are three different options for fixing this mismatch:
Install the latest Windows 10 SDK (19041). For VS 2019, this is done by running Visual Studio Installer and selecting the new Windows 10 SDK as a component. For VS 2017, you need to run the standalone installer. VS 2015 and earlier are not supported.
Use a version of the D3DX12.H utility header that supports older SDKs. I maintain a version of the 'latest' D3DX12.H header that contains a bunch of preprocessor conditionals so that it will support Windows 10 SDK (14393) or later. That happens to be last version of the Windows 10 SDK to support VS 2015. Obtain it from GitHub: directx-vs-templates.
Use GitHub DirectX-Headers: A new option is to get the latest headers including D3DX12.H as a set from GitHub. You still need a Windows 10 SDK for the link libraries.
See this blog post for details on why D3DX12.H is not part of the Windows 10 SDK.
The samples on DirectX-Graphics-Samples in the main/master branch assume you are using the latest Windows 10 SDK (19041).
As you are new to DirectX 12, you may want to take a look at DirectX Tool Kit for DX12 as a more gentle introduction to the latest version of the API.
QUESTION
In DirectX Graphics Samples MiniEngine sample, there is an "inline" source file Functions.inl that uses a macro INLINE
that is defined in a header in same folder, Common.h .
What mechanism/declaration permits Functions.inl to use INLINE
without an #include "Common.h"
statement?
My specific issue is that I have created a VS2019 UWP C++ project, and I am importing a subset of this source and cannot compile the copy of Functions.inl without modifying and adding an #include
statement.
ANSWER
Answered 2020-Jul-21 at 21:05The *.inl
extension is usually used to indicate that the file is an inline-definition of something defined in a header. Effectively, the *.inl
file is generally treated as an inline-equivalent to a *.cpp
file.
In the same way that *.cpp
files can use symbols #include
d in the header for that *.cpp
file, *.inl
files usually have the same assumption.
In this specific example. it appears that Functions.inl
is included after a bunch of other headers are included
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DirectX-Graphics-Samples
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page