Static samplers vs sampler heap

Started by
3 comments, last by Hodgman 6 years, 12 months ago

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.

-potential energy is easily made kinetic-

Advertisement

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.

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?

-potential energy is easily made kinetic-

This topic is closed to new replies.

Advertisement