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 [direct3d12]
79 questions
14
votes
1 answer
New to Direct3D programming: 11 vs 12
For a newbie in D3D programming, should one just learn D3D12 directly or is D3D11 necessary before diving into D3D12?
Assuming starting from scratch and decent knowledge of C++, which way should I go?

CodeAngry
- 12,760
- 3
- 50
- 57
12
votes
2 answers
GetCPUDescriptorHandleForHeapStart stack corruption
I've stumbled upon a rather unusual problem while programming with DirectX 12.0. No research so far has been insightful.
I am programming using C (not C++). It would appear the official DirectX 12 headers support bindings for both C and C++, however…

Cara Ames
- 255
- 1
- 11
7
votes
1 answer
Getting display's refresh rate on D3D12
I am porting my code to D3D12 from D3D11 and I'm trying to obtain display's refresh rate on D3D12. I use the refresh rate for precise animation timing (this is a hard requirement). This code works on D3D11:
HRESULT GetRefreshRate(IUnknown* device,…

Sunius
- 2,789
- 18
- 30
6
votes
3 answers
What is the point of D3D12's SetGraphicsRootSignature?
I am a little confused about the existence of the ID3D12GraphicsCommandList::SetGraphicsRootSignature method. From what I understand of this MSDN page, it seems that the only valid usage of it is to always call it after SetPipelineState, giving it…

Trillian
- 6,207
- 1
- 26
- 36
6
votes
4 answers
How do you draw text in DirectX 12?
This is a follow-up question of How do you draw text in DirectX 11?
In Direct3D-12, things got much more complex and since it's new I couldn't find any suitable libraries online.
I'm building a basic Direct3D12 FPS Test application, and I like to…

ngub05
- 566
- 1
- 8
- 15
5
votes
2 answers
How to synchronize CPU and GPU using fence in DirectX / Direct3D 12?
I'm beginning learning Direct3D 12 and having difficulty in understanding CPU-GPU synchronization. As far as I understand, fence (ID3D12Fence) is no more than a UINT64(unsigned long long) value used as counter. But its methods confuse me. The below…

YoonSeok OH
- 647
- 2
- 7
- 15
5
votes
1 answer
Which format to use for a shader resource view into depth-stencil buffer resource?
The depth-stencil buffer resource is defined as DXGI_FORMAT_D24_UNORM_S8_UINT format.
I would have assumed that to create a shader resource view (SRV) into that resource would require the view format to be described either…

Jaanus Varus
- 3,508
- 3
- 31
- 49
4
votes
2 answers
D3D12 unavoidable leak report
This program:
#include
#pragma comment(lib,"d3d12")
int main()
{
ID3D12Debug *pDebug = NULL;
D3D12GetDebugInterface(__uuidof(ID3D12Debug),(void**)&pDebug);
pDebug->EnableDebugLayer();
pDebug->Release();
ID3D12Device…

Wessam Bahnassi
- 145
- 1
- 8
3
votes
0 answers
Can native vertex buffer be copied from on GPU using native plugin interface prior to Unity 2021.2
Can native vertex buffer be copied from on GPU using native plugin interface?
I'm asking specifically about directx12, vulkan, metal as I know for certain this can be done with directx11. Furthermore, I only ask about Unity versions prior to…

gregee123
- 321
- 3
- 6
3
votes
1 answer
Is fullscreen really better than windowed mode in a Direct3D 12 application?
I'm trying to learn Direct3D 12 to do some simple 3D graphics for fun.
I've heard that pure fullscreen is the way to go for maximum fps, but now that I'm testing it, fullscreen seems way, way worse than windowed mode.
For example, a static color on…

BubLblckZ
- 434
- 4
- 14
3
votes
1 answer
Retrieving D3D12 Video Decode Status
I am implementing a H264 video decoder through Direct3D 12 APIs - while I am very new to Direct3D I do have experience with other graphics APIs and H264. I have been struggling to find decent examples of D3D12 video decoding but have got as far as…

Rich Logan
- 39
- 6
3
votes
2 answers
Is there a way to receive as a string, the errors from DX12?
Example: Here's the debug log for CreateGraphicsPipelineState, it tells me what went wrong:
D3D12 ERROR: ID3D12Device::CreateGraphicsPipelineState: Root Signature doesn't match Vertex Shader: Shader CBV descriptor range (RegisterSpace=0,…

cmaughan
- 2,596
- 5
- 30
- 35
3
votes
2 answers
How to write to the image directly by CPU when load it in Vulkan?
In Direct3D12, you can use "ID3D12Resource::WriteToSubresource" to enable zero-copy optimizations for UMA adapters.
What is the equivalent of "ID3D12Resource::WriteToSubresource" in Vulkan?

Hanetaka Chou
- 51
- 7
3
votes
2 answers
Convert DXBC to DXIL (DirectX Bytecode to DirectX Intermediate Language)
Microsoft's open source DirectX Shader Compiler describes the format of a new intermediate language (IL) for HLSL shaders called DXIL.
The documentation makes reference to a converter from the previous HLSL IL, called DXBC, to the new DXIL:…

Kerry Seitz
- 43
- 1
- 6
3
votes
2 answers
Can I change binding points in a compiled D3D shader?
I have an HLSL shader that defines some resources, say a constant buffer:
cbuffer MyCB : register(b0);
If I compile my shader, I will then be able to query the register through the reflection API. But is it possible to change the register (for…

Egor
- 779
- 5
- 20