[PATCH] wined3d/resource: Performance improvement

Patrick Rudolph siro at das-labor.org
Sat Jul 2 01:49:08 CDT 2016


> 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.

Both flags are independent of each other and provide useful information
to the OpenGL driver. The driver knows best how to map the resource.
By passing NOOVERWRITE and DISCARD it's likely going to use NOOVERWRITE,
as it's even less overhead than DISCARD.

I don't think that WINE should drop flags, except there's a driver bug
that can't be fixed (in the near future).

Regards,
Patrick



More information about the wine-devel mailing list