Jump to content
Posted 30 November 2012 - 05:50 PM
Posted 30 November 2012 - 06:29 PM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Posted 30 November 2012 - 06:54 PM
This is expected, as MAP_WRITE_DISCARD requires behind the scene to invalidate the previous buffer, and It has no other ways than to allocate a new buffer on the CPU side before sending it later to a new buffer on the GPU (and releasing the previous GPU buffer). So basically, at the time you use MAP_WRITE_DISCARD, It is not writing directly to the GPU memory, but delaying the writing (and storing this in a temp buffer).
After the end of these lines, the amount of memory the program uses is greater than before. If it does in fact keep the vertices stored in main RAM and video RAM, what is the reason for this?
Posted 30 November 2012 - 07:22 PM
Edited by MJP, 01 December 2012 - 02:00 AM.
Posted 30 November 2012 - 08:23 PM
Edited by xoofx, 30 November 2012 - 08:24 PM.
Posted 01 December 2012 - 01:54 PM
@MJP, indeed, unlike D3D9, D3D11 doesn't make any strict assumption about the location of the memory, but a MAP_WRITE_DISCARD needs anyway to allocate a new buffer, even if it is in a shared memory, and the previous memory of the buffer will be released at a later "flush" when It is no longer being used by the GPU. So in practice, when using MAP_WRITE_DISCARD, you are more likely to at *least* double the memory usage (exactly like a double buffering).
Posted 01 December 2012 - 02:36 PM
Posted 01 December 2012 - 03:46 PM