On 06/30/2016 10:20 AM, Patrick Rudolph wrote:
Tests on Windows showed that mapping a buffer with flags WINED3D_MAP_DISCARD and WINED3D_MAP_NOOVERWRITE is valid combination. Writing reliable tests is difficult as the driver is free to choose when using discard.
Unigine Heavon maps a lot of buffers with both flags, but run on about 85% GPU-load, as WINE removes both hints and the game has to wait for the buffer to be mapped.
It makes logical sense to me that mapping a buffer with both DISCARD and NOOVERWRITE would effectively ignore NOOVERWRITE. I've noticed that at least some engines will map a part of a buffer with NOOVERWRITE and draw with that part, map the next part of the buffer with NOOVERWRITE and draw with that part, etc, then after the last part of the buffer it maps with DISCARD to get new memory and keep going while the previous buffer memory is handled asynchronously by the driver or card.
I notice that wined3d has some parts where it ignores/removes DISCARD, so it may not be a good idea to leave both DISCARD and NOOVERWRITE set. In such a case, the driver will get NOOVERWRITE for a part of the buffer that's still in use. It would probably be better to remove NOOVERWRITE when both DISCARD and NOOVERWRITE are set.