There's a good presentation about this: Don't Throw It All Away: Efficient Buffer Management by John McDonald at NVIDIA. It covers various topics, but on the subject of your question, the general advice is to create buffers with dynamic usage and use Map() with D3D11_MAP_WRITE_DISCARD, when the data needs to be updated frequently (like every frame, or multiple times per frame). This would be used for constant buffers, vertex buffers for particle systems, and suchlike.

According to the presentation, default usage / UpdateSubresource() incurs more CPU overhead than dynamic usage / Map(). However, he does recommend default usage / UpdateSubresource() for data that needs to be updated only once in awhile, such as data streamed in from disk in an open-world game.

And yes, in the case where you use UpdateSubresource(), you would use it by itself, not in combination with Map().



发布了19 篇原创文章 · 获赞 5 · 访问量 22万+


©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客