• Advertisement
Sign in to follow this  

DX12 dx12 - dynamically indexable resources -what exactly it means?

This topic is 1254 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

"In addition to the improved performance offered by descriptor heaps and tables, Direct3D 12 also allows resources to be dynamically indexed in shaders, providing unprecedented flexibility and unlocking new rendering techniques.  As an example, modern deferred rendering engines typically encode a material or object identifier of some kind to the intermediate g-buffer.  In Direct3D 11, these engines must be careful to avoid using too many materials, as including too many in one g-buffer can significantly slow down the final render pass.  With dynamically indexable resources, a scene with a thousand materials can be finalized just as quickly as one with only ten."

link

 

Does this means we will be able to bind lots of textures to a shader and than based on a drawable material (cb variable) pick the correct texture (index to texture) ?

 

Say I have a 2d game and I managed to put all my images on only 3 texture atlas, can I bind the 3 textures and never worry about textures again, as my sprites material will have an index to texture, being able to draw everything w/ a single draw call.

 

Did I get it all wrong?

Edited by Icebone1000

Share this post


Link to post
Share on other sites
Advertisement

Yes, that's correct: it allows a shader to dynamically select a texture without having to use atlases or texture arrays. However there may be performance implications for doing this, depending on the hardware.

Share this post


Link to post
Share on other sites

Doesn't that mean if we stuff all vertices and indices into single buffer (along with texture indexes) theoretically it'll be possible to render whole scene in a single draw call (assuming everything uses same shader)?

Share this post


Link to post
Share on other sites

Yes, but at the same time, draw-calls will no longer be a source of excessive CPU-side overhead, as in current APIs (D3D9 < GL < D3D11 < D3D12/Mantle).

You can do that on some GL drivers at the moment by using MultiDrawIndirect and bindless resources.

 

Modern hardware doesn't actually have a fixed-function Input Assembler any more -- instead the logic for reading vertex data from buffers is implemented inside the vertex shader code (the driver prepends this code onto your shaders)... So in theory you could even still have stuff in different buffers if you wanted to, and then implement the logic to pick the appropriate buffer in the VS wink.png

Edited by Hodgman

Share this post


Link to post
Share on other sites

I have a gtx 260m, a d3d10 card, so D3D11 is used with d3d10 feature level. Will feature levels still apply with D3D12? Or Im pretty much screwed?

 

"DirectX 12 (and D3D 12) are backwards compatible with virtually every single GPU from the GTX 400 to the present day."link

 

So, d3d10 is about to be dropped together with windows xp?

Share this post


Link to post
Share on other sites

I have a gtx 260m, a d3d10 card, so D3D11 is used with d3d10 feature level. Will feature levels still apply with D3D12? Or Im pretty much screwed?

 

"DirectX 12 (and D3D 12) are backwards compatible with virtually every single GPU from the GTX 400 to the present day."link

 

So, d3d10 is about to be dropped together with windows xp?

 

According to Max McMullen, Direct3D 12 will have feature levels, at least something like a feature level 11.0 (and I think 11.1 and 11.2 cap-bits). Dunno about feature levels 10.x and 9.3, when DX12 will come out, most of PC cards will be at least feature level 11 compliant, but most of mobile SoC will still be feature level 9.1 or 9.3 (Qualcomm SoCs with feature level 11 support are on the way), so probably it will be only a decision of IHVs.

Edited by Alessio1989

Share this post


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

  • Advertisement
  • Advertisement
  • Popular Now

  • Advertisement
  • Similar Content

    • By AxeGuywithanAxe
      I wanted to see how others are currently handling descriptor heap updates and management.
      I've read a few articles and there tends to be three major strategies :
      1 ) You split up descriptor heaps per shader stage ( i.e one for vertex shader , pixel , hull, etc)
      2) You have one descriptor heap for an entire pipeline
      3) You split up descriptor heaps for update each update frequency (i.e EResourceSet_PerInstance , EResourceSet_PerPass , EResourceSet_PerMaterial, etc)
      The benefits of the first two approaches is that it makes it easier to port current code, and descriptor / resource descriptor management and updating tends to be easier to manage, but it seems to be not as efficient.
      The benefits of the third approach seems to be that it's the most efficient because you only manage and update objects when they change.
    • By VietNN
      Hi all,
      I want to copy  just 1 mipmap level of a texture and I am doing like this:
      void CopyTextureRegion( &CD3DX12_TEXTURE_COPY_LOCATION(pDstData, mipmapIndex), 0, 0, 0, &CD3DX12_TEXTURE_COPY_LOCATION(pSrcData, pLayout), nullptr ); - pDstData : is DEFAULT_HEAP, pSrcData is UPLOAD_HEAP(buffer size was get by GetCopyableFootprints from pDstData with highest miplevel), pLayout is D3D12_PLACED_SUBRESOURCE_FOOTPRINT
      - I think the mipmapIndex will point the exact location data of Dest texture, but does it know where to get data location from Src texture because pLayout just contain info of this mipmap(Offset and Footprint).  (???)
      - pLayout has a member name Offset, and I try to modify it but it(Offset) need 512 Alignment but real offset in Src texture does not.
      So what I need to do to match the location of mip texture in Src Texture ?
      @SoldierOfLight @galop1n
    • By _void_
      Hello!
      I am wondering if there is a way to find out how many resources you could bind to the command list directly without putting them in a descriptor table.
      Specifically, I am referring to these guys:
      - SetGraphicsRoot32BitConstant
      - SetGraphicsRoot32BitConstants
      - SetGraphicsRootConstantBufferView
      - SetGraphicsRootShaderResourceView
      - SetGraphicsRootUnorderedAccessView
      I remember from early presentations on D3D12 that the count of allowed resources is hardware dependent and quite small. But I would like to learn some more concrete figures.
    • By lubbe75
      I am trying to set up my sampler correctly so that textures are filtered the way I want. I want to use linear filtering for both min and mag, and I don't want to use any mipmap at all.
      To make sure that mipmap is turned off I set the MipLevels to 1 for my textures.
      For the sampler filter I have tried all kind of combinations, but somehow the mag filter works fine while the min filter doesn't seem to work at all. As I zoom out there seems to be a nearest point filter.
      Is there a catch in Dx12 that makes my min filter not working?
      Do I need to filter manually in my shader? I don't think so since the mag filter works correctly.
      My pixel shader is just a simple texture lookup:
      textureMap.Sample(g_sampler, input.uv); My sampler setup looks like this (SharpDX):
      sampler = new StaticSamplerDescription() { Filter = Filter.MinMagLinearMipPoint, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, ComparisonFunc = Comparison.Never, BorderColor = StaticBorderColor.TransparentBlack, ShaderRegister = 0, RegisterSpace = 0, ShaderVisibility = ShaderVisibility.Pixel, };  
    • By lubbe75
      Does anyone have a working example of how to implement MSAA in DX12? I have read short descriptions and I have seen code fragments on how to do it with DirectX Tool Kit.
      I get the idea, but with all the pipeline states, root descriptions etc I somehow get lost on the way.
      Could someone help me with a link pointing to a small implementation in DirectX 12 (or SharpDX with DX12)?
       
  • Advertisement