[PATCH] [try 4] ddraw: Grow indexbuffer as needed

Henri Verbeet hverbeet at gmail.com
Thu Jun 24 10:56:07 CDT 2010

On 24 June 2010 17:40, Stefan Dösinger <stefandoesinger at gmx.at> wrote:
> Thinking about it, is there a reason for growing the buffer in power of two sizes, and not simply set it to the size required for the draw call? E.g. if the app passes index data with a size somewhere between 2^31 and 2^32-1(which still still fits in the UINT variable) the power of two growing will try to create a 2^32 byte buffer which overflows and fails. So you're cutting the possible index buffer size in half.
If we really cared about those cases we could explicitly handle them,
(e.g. by growing in smaller increments once we're over half the limit)
but I don't think we do. There's also the (more likely) consideration
that creating an index buffer of a certain size will fail due to
running out of memory / address space, while a slightly smaller buffer
might succeed, but I don't think we really care about that one either.

More information about the wine-devel mailing list