0
\$\begingroup\$

I want to build a virtual earth, so I read the book '3D Engine Design for Virtual Globes' by Patrik Cozzi and Kevin Ring. But the book talk the CreateSamplerState in D3d11.I havn't used D3d11, I just learn D3d12 from the book '3D Game Programming WITH DIRECTX 12'by Frank D.Luna. Does it mean the Sampler state in built root signature? I get some D3d12 sample code here,maybe it can help to understand my question:

    // A root signature is an array of root parameters.
CD3DX12_ROOT_SIGNATURE_DESC rootSigDesc(4, slotRootParameter,
    (UINT)staticSamplers.size(), staticSamplers.data(),
    D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT);
\$\endgroup\$
  • \$\begingroup\$ Generally speaking, you should stick with DirectX 11 unless you actually need DirectX 12. DirectX 12 is an expert-level API, and unless you are already hitting the CPU overhead limits of DirectX 11 you likely don't need the additional burden of dealing with DirectX 12. \$\endgroup\$ – Chuck Walbourn Apr 17 '17 at 4:46
1
\$\begingroup\$

With D3D12, you now have two options to provide a sampler state to a shader.

  1. Just like in D3D11, the shader assume nothing, and will read a sampler from a descriptor table bound to the root signature. In code, you will have a descriptor heap for samplers to store them.
  2. In the case the sampler is not a variable parameter but a constant, you can configure it in the root signature, either in the hlsl or by building a root signature description in code. This is useful for things that are not in the hand of an artist, like a shadowmap sampler or a post process.

The option 2 has the advantage to allow some extra shader optimisation, because instead of reading memory to get the sampler, it can be inline in the shader.

\$\endgroup\$
0
\$\begingroup\$

I find some article:

Tutorial: Migrating Your Apps to DirectX* 12 – Part 3

in 3.6,it said: 3.6 Command List/Queue

D3D12 Command List/Queues are features transformed out of D3D11 Device Context. Command List is responsible for buffering rendering commands which are then built into hardware commands known by the driver and finally executed by the Command Queue. Since each Command List can independently fill rendering commands without any intermediate lock protection, it operates faster than its counterpart in D3D11.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.