DirectX 12 introduces the next version of Direct3D, the 3D graphics API at the heart of DirectX. This version of Direct3D is faster and more efficient than any previous version. Direct3D 12 enables richer scenes, more objects, more complex effects, and full utilization of modern GPU hardware. It is supported on Windows 10 and Xbox One.
Questions tagged [directx-12]
347 questions
2
votes
3 answers
Can't find any Directx3D 12 examples
now I want to understand Directx 12 and reading msdn. It says
Working samples are installed with the SDK which demonstrate the following:
I found d3d here C:\Program Files (x86)\Windows Kits\10\Redist\D3D
But where are samples for Directx…
user2872568
1
vote
0 answers
How to Properly Synchronize GPU Rendering and Presentation in a Command Queue?
I'm working on a graphics application where I use a command queue to render scenes. However, I'm facing some uncertainty about when to call Present for my swapchain to ensure that I'm not presenting an incomplete frame.
It's important to note that I…

glack66
- 11
- 1
1
vote
0 answers
Implementing shadow mapping under DirectX 12
I would like to implement shadow mapping inside my renderer. I decided to start with Directional lights. To do so i need to address the following:
1) Render shadow map for each light
To do so I plan to use DXGI_FORMAT_R32_FLOAT shadow maps of…

Cloyz
- 93
- 2
- 11
1
vote
1 answer
What's the difference between using GetAddressOf and & in this DX12 code?
I have the following piece of code from Frank Luna's DX12 book:
D3D12_COMMAND_QUEUE_DESC queueDesc = {};
queueDesc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
queueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;
ThrowIfFailed(md3dDevice->CreateCommandQueue(
…

Francisco José Letterio
- 481
- 1
- 3
- 12
1
vote
1 answer
IDXGISwapChain::GetCurrentBackBufferIndex returns wrong index
I am getting the error
D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: A command list, which writes to a swapchain back buffer, may only be executed when that back buffer is the back buffer that will be presented during the next call to…

Tom Huntington
- 2,260
- 10
- 20
1
vote
1 answer
How to initialize a DirectX 12 Debug Layer Interface
I've been looking at the DirectX12 Documentation.
It uses what are called Com pointers (ComPtr). in the guide most of the ComPtrs have a guides showing how a certain ID3D12 Interface is initialized.
for example ID3D12CommandList is initialized using…

masonCherry
- 894
- 6
- 14
1
vote
0 answers
Why DirectX::Model->LoadTextures failed with "ERROR: CreateWICTextureFromFile failed (80004002) for {path_to_file}.jpg"?
Try using directx12 to render a model, following rendering a model, using its ._obj .mtl .jpg assets, convert these assets to .sdkmesh successfully.
I'm using Directx samples HelloTriangle, try to make some changes in HelloTriangle to render a…

youngh
- 11
- 2
1
vote
0 answers
Handling VSync with multiple swapchains in directx 12
So I am attempting to write a multi window co-op game using directx12. (each player has their own window to allow no screen cheating if they have multiple monitors). But I am having trouble with dealing with VSync when presenting the swapchains for…

yosmo78
- 489
- 4
- 13
1
vote
1 answer
Can I avoid exposing the kernel source code in Direct Compute?
Hiding kernel source or Offline compilation in Direct Compute
For example:
In CUDA, kernel source will be built into .exe and others can't view the kernel source.
In opencl, for first execution, kernel source in .cl file is compiled using…

Zarsr
- 39
- 7
1
vote
1 answer
how to return an object count from compute shader
I've implemented occlusion culling via a compute shader in conjunction with indirect rendering in hlsl on DX12.
I would like to get back a count of the number of objects that have been culled to the CPU for output to console.
The code I have has…

mike
- 1,192
- 9
- 32
1
vote
1 answer
How to manage lifetime for DirectX12 bufferers for instanced game objects
I'm building a game/DirectX12 renderer in c++. I've got most things working and I'm able to statically create in game objects with textures, normalmapping, lighting etc. Since i'm a programmer noob and not an engineer, i'm unsure of how to structure…

Martin
- 33
- 5
1
vote
2 answers
How to add macros to a DirectX12 program
I am building a C++ application that uses DirectX 12 as graphics api.
I want to define macros(for eg #define A_MACRO)
when compiling shader programs.
I looked on the internet but I didn't found where to put it. In terms of code I have this:
Root…

Cloyz
- 93
- 2
- 11
1
vote
0 answers
HLSL REPL? Unit tests?
I'm about to modify an mathematical algorithm and my ptsd is being seriously triggered.
No repl. No unit tests. No ability no mock input data. No asserts. How do game devs stay sane?
Is just recompiling the shader in PIX the best work flow…

Tom Huntington
- 2,260
- 10
- 20
1
vote
1 answer
DRED GetAutoBreadcrumbsOutput() gives hresult DXGI_ERROR_UNSUPPORTED
Naively copy pasting from https://devblogs.microsoft.com/directx/dred/
winrt::com_ptr…

Tom Huntington
- 2,260
- 10
- 20
1
vote
0 answers
Retrieving the amount of available adapter memory in DirectX 11
DirectX 9 had IDirect3DDevice9::GetAvailableTextureMem() which gives an estimate. I cannot readily find the equivalent in DirectX 11.
I found DXGI_ADAPTER_DESC.DedicatedVideoMemory which gives me the total, but what I’d like in addition to that is…

Axel Rietschin
- 611
- 1
- 7
- 10