Questions tagged [directx12]
DirectX 12 is the 12th version of Microsoft's DirectX API, which is used to develop and handle tasks related to Multimedia, such as game programming, 3D visualizations and video on Microsoft platforms.
68 questions
0
votes
1
answer
113
views
What is the proper way to write a pixel shader that only outputs depth?
I have an effect that I want to only write to depth.
commandList->OMSetRenderTargets(0, nullptr, FALSE, &m_mainDepthStencilDescriptorHandle.getCpuHandle());
...
0
votes
0
answers
52
views
My cube in my DX12 window never shows
My cube never shows in my DX12 window. Instead I see the Windows buffering icon show until I click out of the window at which point it goes away. I see the blue background in my window but no cube. I ...
0
votes
0
answers
160
views
How to debug: "D3D12 WARNING: Process is terminating. Using simple reporting."
I have an interop program with DX12 resources, and it exits with:
...
1
vote
2
answers
223
views
Can't write DepthBuffer — result is completely white
I am new to DX12 and I am currently trying to get the depth buffer to work. I have done pretty much everything identical to blog posts I've seen online. I can also see that the ...
0
votes
0
answers
102
views
Are there common mistakes leading to STATE_SETTING ERROR #907: EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE?
I got an 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 ...
2
votes
1
answer
231
views
How to sample a R8_UINT texture in hlsl?
I'm a newbie in DX12 and trying to visualize Stencil buffer onto screen. I've been copied stencil plane slice into a DXGI_FORMAT_R8_UINT texture, but when HLSL samples this texture it just returns 0, ...
1
vote
1
answer
102
views
1
vote
1
answer
260
views
How do real time cutscenes work?
I want to code a real time cutscene editor in my engine but I couldn't find any pdf documents or websites explaining it in detail. Is the cinematic scene file loaded with instructions like ...
1
vote
1
answer
328
views
Is DirectX 12 or lower just an API?
I am programming a game using DirectX 12. Shall it support all GPUs? Or just newer GPUs? What about the version of the Windows OS supported?
What changes when a new DirectX version comes?
1
vote
1
answer
153
views
Issues with binding structure layout in the shaders which translated from glsl to hlsl
I have a small issue with my shaders. Sorry if it is not the right place for this question. In general, the essence is that for my application on dx12, I have shaders in glsl (I'm too lazy to rewrite ...
2
votes
1
answer
166
views
How should I bind various types of material data to the ray tracing rendering pipeline in DirectX12?
My problem is a bit complicated. When doing ray tracing rendering, all data in the scene needs to be prepared. In addition to texture resources, each object to be rendered will also have its own ...
4
votes
1
answer
2k
views
What does VSync mean on a variable refresh rate monitor?
A game which enables VSync means that the game frames get synchronized to the monitor's refresh rate (to avoid tearing).
A variable refresh rate monitor means that the monitor refresh rate gets ...
2
votes
1
answer
482
views
How to deal with different version of Direct3D12 interfaces?
Let's say I want to enable debug layers for a Direct3D 12 renderer, for which I need to create a ID3D12Debug object. Problem is, there are 6 different version of ...
1
vote
1
answer
1k
views
How to read pixel data from a ID3D12Resource?
I'm trying to read pixel data of a D3D12 render target (ID3D12Resource) for h264 encoding/streaming, I tried asking on DirectX Discord and also GPT and still I got ...
5
votes
1
answer
2k
views
What does each byte in DXGI_FORMAT_R8G8B8A8_UNORM store?
I'm studying DX12. I came across this texture format:
DXGI_FORMAT_R8G8B8A8_UNORM
A four-component, 32-bit unsigned-normalized-integer format that supports 8 bits per channel including alpha.
It's ...
1
vote
1
answer
1k
views
Difference between Command Lists and Deferred context
I'm new to DirectX and I feel like I killed Google search but still cannot find information about the difference between these:
Immediate context + Command Lists
Immediate context + Deferred context (...
0
votes
0
answers
54
views
How to play back multiple 4K videos with resizing and cropping
I'm looking for playing multiple videos (source HD and 4k, 10 bits), between 3 and 12+ videos, which could be cropped and resized, and those be adjusted on the fly (as videos are being played), sent ...
0
votes
1
answer
506
views
"An ID3D12Resource object is referenced by GPU operations in-flight on Command Queue": When Should I Create my Buffers?
When trying to re-create my vertex buffers, my app crashes and I get this error:
D3D12 ERROR: ID3D12Resource2::: CORRUPTION: An ID3D12Resource object (0x000001DDEBA98FC0:'Vertex Buffer Default ...
1
vote
1
answer
330
views
Creating RTV for each array slice of a Texture2DArray
I'm trying to implement depth peeling onto a 2D texture array, where each array slice corresponds to a depth layer. In order to do this, I'd like to draw to subsequent array slices of this texture, ...
0
votes
0
answers
683
views
Directx12 command list reset close memory leak
I simply reset and close the command list but my memory usage goes up 5 gb per second.
This is the simple list of things I do
Reset command buffer
Close command buffer
Reset command allocator
I feel ...
1
vote
1
answer
624
views
D3D12: how to enable perspective correction when interpolating UV coordinates?
Good morning,
I am currently running into a UV interpolation issue with D3D12 that looks like this:
Is there something that needs to be set when initialising the pipeline so that the GPU does the ...
0
votes
1
answer
2k
views
How do I corretly use a Direct X 12 Root Signature?
I know a Direct X 12 Root Signature tells Direct X 12 how to use the resources between the CPU and GPU, but I'm having a hard time using it.
I tried using it before but it kept failing saying the ...
1
vote
1
answer
2k
views
How many command lists should there be in DirectX 12?
I'm new to DirectX 12. I understand some of the basics.
For speed and optimization, is it better if I have more than one command queue, command list, and command allocator? If so, how many should I ...
1
vote
1
answer
369
views
What's the relationship between the actor's pose and shape's pose in PhysX?
I have 2 Meshes and I want to add physics to them. The first is a primitive box, the second is a terrain.
The box and terrain are made with DirectXMath
Using the PhysX library, I made a copy of the ...
0
votes
1
answer
187
views
Moving the bulk of a recursive ray tracer function to the gpu, using DirectX12 not DirectX 12 DXR HLSL
So I'm wanting to generate images by ray tracing. I've done so, but the main ray function is recursive. I know one can make a non recursive function out of a recursive function using a stack, but is ...
0
votes
1
answer
581
views
Compile shader and root signature of a ray tracing shader into a single binary using DXC
I'm new to DXR, so please
If I got it right, when we want to compile a ray tracing shader using the DirectX Shader Compiler, we need to specify lib_6_* as the ...
0
votes
1
answer
1k
views
Specifying a root signature in the HLSL code of a DXR shader
I've noticed that I cannot specify a root signature in the HLSL code of a DXR shader. For example, if I got a ray generation shader with the following declaration
...
2
votes
0
answers
205
views
How to get struct layouts from vertex shader input using ID3D12Reflection
I am attempting to write a code generator that builds C++ structs/classes from D3D12 reflection data built using DXC. Given a simple vertex shader signature:
...
1
vote
1
answer
480
views
DX12 - how to update part of a buffer?
I'm just getting started in DX12 after a bit of time in Vulkan, I am trying to update a part of a dynamically indexed buffer I'm using to hold mesh transforms.
I'm using the MSFT MiniEngine examples ...
1
vote
1
answer
350
views
Difference between shader input element classification between D3D12 and Vulkan
I'm confused about the difference between the shader input element classifications in D3D12 and Vulkan. For example, in Vulkan I could have the following declarations:
...
0
votes
1
answer
348
views
Building a unified interface for a swap chain in both DirectX 12 and Vulkan
Most objects in DirectX 12 have natural analogues in Vulkan, e.g.
VkInstance = IDXGIFactory
...
0
votes
1
answer
4k
views
Howto use the depth buffer in DirectX 12
To make things short: I am trying to bind and use a depth buffer in D3D12, but it is not working. The depth buffer gets created and bound properly (I can see it in nsight graphics) but does only take ...
1
vote
1
answer
2k
views
0
votes
1
answer
830
views
How to set root signatures specified in HLSL in my command list?
From Microsoft Docs, I can specify the root signature of my shader in HLSL. How do I use it though?
Since at the beginning of the command list, root signature is undefined. I need to use ...
0
votes
1
answer
2k
views
DirectX12 root signature error while using compute shader with ConsumeStructuredBuffer
I am getting this error: I do not have CBV, but it looks like I am forgetting to bind a CBV.
D3D12 ERROR: ID3D12Device::CreateComputePipelineState: Root Signature doesn't match Compute Shader: ...
3
votes
1
answer
951
views
How can I write a D3D12 texture in cuda?
One point about such pipeline is that everything happens in GPU and bypass the CPU.
The texture is created as such:
...
1
vote
1
answer
101
views
What is the difference between cudaExternalMemoryHandleTypeD3D12Resource and cudaExternalMemoryHandleTypeD3D12Heap?
When we import a D3D12 memory object into cuda we do something like this:
...
0
votes
1
answer
375
views
How to get DXGI_ERROR description?
In a D3D12 program, I encounter a DGXI_ERROR (CreateSharedHandle return an int <0), but I ...
1
vote
1
answer
4k
views
Resize window in D3D12
I am trying to implement the d3d12 window resizing function. First, I delete all the buffers referenced by SwapChain, and then run SwapChain :: ResizeBuffers. At this point I get the error:
...
0
votes
0
answers
444
views
Array textures on Pixel shader
I'm developing on D3D11 and D3D12 in parallel. D3D12 is really difficult, but I learn it gradually. I faced a problem such as passing an array of textures to a vertex Shader. The method ...
0
votes
0
answers
85
views
Shader code not working
While compiling the following code. I get a error
...
1
vote
1
answer
190
views
What is the difference between D3D12 structures/functions with terminal 1 in the name and without?
I could not figure out the difference between for instance
CD3DX12_DESCRIPTOR_RANGE and CD3DX12_DESCRIPTOR_RANGE1.
Why do both exist? Which should I use? Is there a general rule of behavior/usage/...
0
votes
1
answer
1k
views
D3D12CreateDevice(pAdapter, D3D_FEATURE_LEVEL_12_0) ISSUE
I'm getting this error when I compile this code.
D3D12CreateDevice(pAdapter, D3D_FEATURE_LEVEL_12_0,
IID_PPV_ARGS(&pDevice)).
Error! No such Interface supported
I've got a rtx 2060 GPU installed ...
0
votes
0
answers
26
views
Directx Ray Tracing Dxr Support Application Issue
I have a question, I have source code that is old that was built in visual studio 2003 and It does not allow me to compile DirectX12 code in visual studio 2003 so my Attentions was to take my old game ...
0
votes
1
answer
1k
views
error X4016: SV_InstanceID semantic cannot be used with 10Level9 targets
I'm using a variant of the D3D12 UWP template that comes with VS2017 Community Edition and I have two related questions:
When I add this italicized and bolded code to the vertex shader signature, I ...
0
votes
1
answer
649
views
Rendering PhysX Primitive Geometry in DirectX 12
I created a scene with two primitive geometries (Sphere and Box). Now I want to recreate what I see in the scene (PhysX Visual Debugger) in my game engine window, but I can't find any functions that ...
4
votes
1
answer
4k
views
Why are committed resources better than placed resources?
This NVIDIA document regarding dos and don'ts in DirectX 12 states the following:
Use committed resources where possible to give the driver more
knowledge
This allows the driver to better ...
1
vote
1
answer
833
views
Directx 12 Root signature compatibility with pso
Can you bind a different root signature than the one that pipeline was created with? If so does it have to have exactly the same parameters or could it have like one more but the pipeline will ignore ...
3
votes
0
answers
220
views
Are GPU drivers hand optimized for specific games using low-level APIs?
The GPU drivers often have slightly different behavior depending on game or program, which is using them. It optimizes performance, bypasses bugs and improves overall experience in popular games, ...
2
votes
1
answer
3k
views
DX12 Passing an Instance Buffer
I'm trying to take the DX12 Cube Demo that comes with VS2017 Community and draw three cubes instead of one. Unfortunately, the VertexShader doesn't seem to be getting my instance data.
In my ...