Sign in to follow this  
Infinisearch

Static samplers vs sampler heap

Recommended Posts

What are the advantages and disadvantages of both?  Also can someone explain the implementation of static samplers?  They don't take any space in the root signature so my guess is they are in the startup code of the PSO maybe?

Thanks in advance for any help.

Share this post


Link to post
Share on other sites

The implementation really depends on the hardware and driver. AMD hardware is capable of synthesizing sampler descriptors using shader code, so it's very possible that they do this for static samplers. With Nvidia hardware nobody knows how it really works, so it's possible that they turn the static samplers into registers or store descriptors located in memory. You'll notice in the docs that there's a limit of 2032 total unique static samplers across all live root signatures, which suggests that there are implementations that may need to convert static samplers into something heap-based. 

With that in mind, I wouldn't make decisions based off of implementation details since they're not guaranteed. None of the IHV's have said anything positive or negative about static sampler performance or limitations, so I would just make your decision based on what works best for your engine. Personally I like static samplers since they spare me from having to create and bind descriptor tables, which I find pretty convenient. 

Share this post


Link to post
Share on other sites

Thanks for the quick reply MJP.  You're right about not basing design choices based on implementation but I'm curious about the implementation of GPU's, drivers, and dx12 in general anyway.  So besides the limitation on the number of static samplers IIRC there is something you can only do with samplers in a heap and not static samplers. (I forgot what it was though, unless my memory is confusing samplers with something else.)  So there no guidance on static samplers at all?

edit - BTW MJP if its not under NDA could you tell me if dx12 for XBONE is the same as for desktop?

Edited by Infinisearch

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this