[PATCH v2] wined3d: Allow setting user memory for mipmapped texture in wined3d_texture_update_desc().

Henri Verbeet hverbeet at gmail.com
Fri May 8 12:40:49 CDT 2020

On Thu, 7 May 2020 at 13:54, Paul Gofman <pgofman at codeweavers.com> wrote:
> +    set_user_memory_only = width == texture->resource.width && height == texture->resource.height
> +            && format_id == texture->resource.format->id && multisample_type == texture->resource.multisample_type
> +            && multisample_quality == texture->resource.multisample_quality
> +            && (!texture->row_pitch || pitch == texture->row_pitch);
> +
The pitch handling doesn't seem quite right. I.e., if
texture->row_pitch is currently 0 (default), it effectively has the
value calculated by wined3d_format_calculate_pitch() with the default
alignment. That's potentially different from "pitch". Even if "pitch"
is 0 itself, it may still be effectively different due to the
different alignment value. You'll probably want to first calculate the
effective current and new pitch, and then compare those.

Does SetSurfaceDesc() work with mip-mapped surfaces as well? Otherwise
we may have to explicitly disallow them there. Likewise for surfaces
created with DDSD_LPSURFACE set.

More information about the wine-devel mailing list