[PATCH 4/5] wined3d: Reject unsupported pitches in wined3d_surface_update_desc().

Henri Verbeet hverbeet at gmail.com
Wed Feb 18 09:44:01 CST 2015

On 18 February 2015 at 16:07, Stefan Dösinger <stefandoesinger at gmail.com> wrote:
> Am 2015-02-18 um 14:20 schrieb Matteo Bruni:
>> +    if (pitch & (texture_resource->format->byte_count - 1))
I don't think this would do the right thing for formats where
byte_count isn't a power of two. I also think the check belongs in
wined3d_texture_update_desc(), since otherwise the texture would be in
an inconsistent state if it fails. (That actually also applies to
failing to create the DIB section, but that one seems much harder to

>> +    {
>> +        WARN("Pitch unsupported, not a multiple of the texture format byte width.\n");
>> +        return WINED3DERR_INVALIDCALL;
>> +    }
> I'd prefer this to be an ERR instead, and the return statement removed.
> The idea is that since we don't ever expect this check to be true it
> shouldn't result in different behavior and can be compiled out in a
> build where debugging is disabled.
It's a bit debatable in this case, since that depends on assumptions
about callers outside of wined3d.

More information about the wine-devel mailing list