码迷,mamicode.com
首页 > 其他好文 > 详细

dx12 memory management

时间:2018-04-13 17:49:01      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:com   off   table   ever   until   rom   sof   https   rman   

https://msdn.microsoft.com/en-us/library/windows/desktop/dn508285(v=vs.85).aspx

Map with D3D11_MAP_WRITE_DISCARD, the runtime returns a pointer to a new region of memory instead of the old buffer data.

This allows the GPU to continue using the old data while the app places data in the new buffer.

No additional memory management is required in the app; the old buffer is reused or destroyed automatically when the GPU is finished with it.

好神奇

Note  When you map a buffer with D3D11_MAP_WRITE_DISCARD, the runtime always discards the entire buffer.

You can‘t preserve info in unmapped areas of the buffer by specifying a nonzero offset or limited size field.

 

When you call Map on a static vertex buffer while the GPU is using the buffer, you get a significant performance penalty. In this situation,

 Map must wait until the GPU is finished reading vertex or index data from the buffer before Map can return to the calling app, which causes a significant delay.

Calling Map and then rendering from a static buffer several times per frame also prevents the GPU from buffering rendering commands

because it must finish commands before returning the map pointer.

Without buffered commands, the GPU remains idle until after the app is finished filling the vertex buffer or index buffer and issues a rendering command.

 

D3D11_USAGE_IMMUTABLE is well-suited to data such as textures because such data is typically read into memory from some file format.

Therefore, when you create a texture with D3D11_USAGE_IMMUTABLE, the GPU directly reads that texture into memory.

dx12 memory management

标签:com   off   table   ever   until   rom   sof   https   rman   

原文地址:https://www.cnblogs.com/minggoddess/p/8821510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!