Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


[D3D12] Create anything anywhere?

  • You cannot reply to this topic
5 replies to this topic

#1 Infinisearch   Members   -  Reputation: 607

Like
0Likes
Like

Posted Today, 12:03 PM

D3D12

 

Forgetting performance, it seems (at least to me) to be possible to create anything anywhere.  A index buffer in system memory rather than graphic local memory or to use D3D12 terminology, an index buffer in POOL_L0 rather than POOL_L1.  Am I reading things wrong or can you create anything anywhere?  Or is this GPU/driver dependent?  So if I wanted to create a default heap in POOL_L0 create a placed resource (lets say index buffer) in said heap and render from it there would be no problem right?


-potential energy is easily made kinetic-

Sponsor:

#2 BornToCode   Members   -  Reputation: 1069

Like
0Likes
Like

Posted Today, 12:22 PM

A Default heap can only read and write on the GPU side. The CPU cannot see that memory. This is the faster because the memory is right then and there on the Graphics card.

A Upload heap the CPU can write to it but not read, and the GPU can read from it but not write to it. This is slow because the GPU will have to marshalled over everytime it needs that data.

A ReadBack heap allows the CPU to read the Data. This is even slower because the CPU needs to request the data from GPU which in terms will write the data to some piece of memory which the CPU can safely read from. This can be used for when you are dealing with Video Capture for example.

 

So at the end of the day, yes you can create things anywhere you want depeneding on what you are trying to achieve and how do you want to access that data.



#3 Infinisearch   Members   -  Reputation: 607

Like
0Likes
Like

Posted Today, 01:02 PM


A Default heap can only read and write on the GPU side. The CPU cannot see that memory. This is the faster because the memory is right then and there on the Graphics card.

If you look at the D3D12_HEAP_PROPERTIES structure used to create heaps you can specify a type and a memory pool preference at the same time.  This leads me to believe that you can have a default heap in non-gpu local memory.  This is what I'm asking about.


-potential energy is easily made kinetic-

#4 Matias Goldberg   Crossbones+   -  Reputation: 5562

Like
0Likes
Like

Posted Today, 01:10 PM

Forgetting performance, it seems (at least to me) to be possible to create anything anywhere.

Yes. Performance is the big main concern.
However if you request too much memory of the wrong type (i.e. CPU and GPU visible) you may find yourself running out of it very quickly due to hardware limitations.

would be no problem right?

Don't push it. Follow recommendations.
D3D12 will allow you to do anything, it doesn't mean it will work on all GPUs. You will get no warning whatsoever.
D3D12's documentation itself states heaps of type D3D12_HEAP_TYPE_READBACK must stay in D3D12_RESOURCE_STATE_COPY_DEST; which in plain english it means not all GPUs may be able to use it as a direct source for, say, vertex buffers (since it should be in STATE_VERTEX_AND_CONSTANT_BUFFER)

#5 Infinisearch   Members   -  Reputation: 607

Like
0Likes
Like

Posted Today, 01:28 PM


However if you request too much memory of the wrong type (i.e. CPU and GPU visible) you may find yourself running out of it very quickly due to hardware limitations.

Could you elaborate on this?  I thought as long as you stay in the "budget" of a particular memory pool you'd be alright.  I.E. IDXGIAdapter3::QueryVideoMemoryInfo method with DXGI_MEMORY_SEGMENT_GROUP set to DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL.

 


Don't push it. Follow recommendations.

I didn't see any recommendations in this case, that's why I asked here.  The only thing to go on is common sense in regards to memory bandwidth, but I've been thinking about streaming content, and acceptable perfomance for subsections of rendering which is why I wanted to know if it is possible and if there are limitations based on video card/drivers.


-potential energy is easily made kinetic-

#6 BornToCode   Members   -  Reputation: 1069

Like
0Likes
Like

Posted Today, 01:54 PM

Yes you can specify the location but if you try to use an upload heap or read back in L1 it will fail.





PARTNERS