Questions tagged [direct3d12]

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.

54 questions
12
votes
1 answer

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
  • 221
  • 1
  • 8
10
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
  • 11,799
  • 3
  • 46
  • 52
4
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,291
  • 3
  • 27
  • 45
4
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
  • 5,747
  • 1
  • 23
  • 35
3
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,237
  • 14
  • 24
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?
3
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…
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
  • 507
  • 2
  • 13
3
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
  • 466
  • 1
  • 6
  • 14
3
votes
1 answer

Initializing D3D12 debug interfaces failing on laptop with GeForce 960M

When I try to call D3D12GetDebugInterface or CreateDXGIFactory2 with the flag DXGI_CREATE_FACTORY_DEBUG, the calls are failing on my laptop, but not on my desktop. Other calls work fine on the laptop and I can render stuff -- I just can't initialize…
Joe
  • 1,910
  • 1
  • 15
  • 23
2
votes
0 answers

HLSL Shader compiles, but crashes when creating compute pipeline state

I have a D3D12 compute shader (Shader Model 6.0) that compiles successfully. When I compile it with optimization disabled (/Od), it runs fine, the outputs are correct. When I enabled optimization, it also compiles, but crashes when I am creating the…
klWu
  • 95
  • 8
2
votes
1 answer

Setting multiple descriptors in a descriptor range in Direct3D 12

First of all, my understanding of a descriptor range is that I can specify multiple buffers (constant buffers in my case) that a shader may use, is that correct? If not, then this is where my misunderstanding is, and the rest of the question will…
klWu
  • 95
  • 8
2
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
  • 267
  • 3
  • 10
2
votes
1 answer

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,475
  • 5
  • 28
  • 34
1
2 3 4