Jump to content
  • Advertisement
Sign in to follow this  
Alessio1989

DX12 Writing a quick reference guide

This topic is 851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Oh, so many views and download but no suggestions (or maybe it's the wrong forum section?) ~Y~

I've uploaded a new draft, hopefully someone will give me some feedbacks, because this "thing" is requiring more time I imaged.
Some notes: structures and enumeration are still missing as a proper annotation.

Share this post


Link to post
Share on other sites

It looks pretty organized and good readable.

Maybe you can add some 'basic startup guide' as reference, describing how you can create a d3d12 device, swapchain, basic resource, 3 vertices and a triangle and draw it to the backbuffer and then flip to screen.

Share this post


Link to post
Share on other sites

Thank you. 

 

I am most concerned about placing the functions in the right section.

 

Actually, I am re-drawing some diagrams (interface hierarchies, pipelines) since those are on MSDN are low-res, and next I will add the structures and enumerations.

 

The basic startup guide is good idea, I will add a final section containing useful references and links too. But first, I need to add all missing structures and enumerations, which are lot. I am also not sure about the formatting, since reading on a screen look not so much comfortable.

Share this post


Link to post
Share on other sites
  • Inconsistent use of DirectX / Direct3D.
  • GetDeviceRemovedReason is in the wrong font
  • GetGPUVirtualAddress and GetGPUDescriptorHandleForHeapStart don't really belong under Command List Creation
  • "Graphics root signature set-up" and "Compute root signature set-up" should probably be called "Graphics/Compute root constant setting". Those functions don't setup the root signature.
  • "Enables some scene-traversal and culling to be moved from the CPU to the GPU." as a description of Indirect Drawing is needlessly use-case specific and doesn't really explain what ExecuteIndirect does.
  • I'd re-order the sections so Heap creation came before View creation
  • "A descriptor heap is a collection of contiguous allocations of descriptors, one allocation for every descriptor" - I'd reword that to not use the word "allocation" in bold. It makes it sounds like there's a memory allocation for each descriptor which there isn't, it's one allocation large enough to contain many descriptors.
  • "ID3D12Resource::GetDesc" doesn't belong under Heap Creation.
  • "ID3D12Device::CreatePlacedResource" doesn't belong under Heap Creation
  • "mesure" -> "measure"
  • GetCurrentBackBufferIndex doesn't belong under "Resizing"
  • [Speculation] Does SetMaximumFrameLatency have any relevance on D3D12? How many frames of data buffered up on the CPU would seem to be under application control already. I'm not sure what this function would/could do on D3D12.

Share this post


Link to post
Share on other sites

Thank you, m'lord. 
 
This is why I was concerned about ordering (that's the price using plain txts I guess).
 

  • GetGPUVirtualAddress and GetGPUDescriptorHandleForHeapStart don't really belong under Command List Creation

Yeah, a subsection called "helpers", maybe under the resources, after descriptor heap creation may be more appropriate.

 

 

  • "Graphics root signature set-up" and "Compute root signature set-up" should probably be called "Graphics/Compute root constant setting". Those functions don't setup the root signature.
  • "Enables some scene-traversal and culling to be moved from the CPU to the GPU." as a description of Indirect Drawing is needlessly use-case specific and doesn't really explain what ExecuteIndirect does.
  • I'd re-order the sections so Heap creation came before View creation
  • "A descriptor heap is a collection of contiguous allocations of descriptors, one allocation for every descriptor" - I'd reword that to not use the word "allocation" in bold. It makes it sounds like there's a memory allocation for each descriptor which there isn't, it's one allocation large enough to contain many descriptors.

 

Got it.

 

 

  • "ID3D12Resource::GetDesc" doesn't belong under Heap Creation.

 

Yep, another helper function for resources.

 

 

  • "ID3D12Device::CreatePlacedResource" doesn't belong under Heap Creation

 

I will move it to resource creation. Better: sub-allocation.

 

 

  • GetCurrentBackBufferIndex doesn't belong under "Resizing"

 

Yes, that's more concerned with presentation and frame buffers rotation. -> Synchronization.

 

 

  • [Speculation] Does SetMaximumFrameLatency have any relevance on D3D12? How many frames of data buffered up on the CPU would seem to be under application control already. I'm not sure what this function would/could do on D3D12.

 


SetMaximumFrameLatency works with D3D12 (but not with Direct3D 11 on 12 AFIK). Intel made a very nice sample showing how to take advantage of D3D12 flip model: https://software.intel.com/en-us/articles/sample-application-for-direct3d-12-flip-model-swap-chains

Edited by Alessio1989

Share this post


Link to post
Share on other sites

Ok I did some correction and added schemas of D3D12 and DXGI interface hierarchies, and one of the graphics pipline (yes, I know they have different scales!... for now)

 

If the order of the content is acceptable I will add proper types (structs, enums), constants, proper colours, fix a lil layout formatting, add some extra comments etc..

 

 

EDIT: also, still need to investigate about d3d12 content protection support

 
DXGI_ERROR_CANNOT_PROTECT_CONTENT
DXGI_ERROR_HW_PROTECTION_OUTOFMEMORY
 
and those missing constants (available only in d3d11 version):
 
D3D12_ERROR_FILE_NOT_FOUND
D3D12_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS
D3D12_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS
 
edit: images fixed.
Edited by Alessio1989

Share this post


Link to post
Share on other sites

just want to say, Allesio, this is a very helpful reference guide your writing, its nice to have everything in one place, and its organized nicely and easy to read

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!