Commit 604d1540 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Only report a broken pitch in wined3d_surface_map().

We'd like the correct pitch for internal calls to wined3d_surface_get_pitch().
parent d67275fe
......@@ -3096,7 +3096,7 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
TRACE("surface %p.\n", surface);
if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
if (format->flags & WINED3DFMT_FLAG_BLOCKS)
{
/* Since compressed formats are block based, pitch means the amount of
* bytes to the next row of block rather than the next row of pixels. */
......@@ -3743,7 +3743,10 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
surface->surface_ops->surface_map(surface, rect, flags);
locked_rect->Pitch = wined3d_surface_get_pitch(surface);
if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
locked_rect->Pitch = surface->resource.width * format->byte_count;
else
locked_rect->Pitch = wined3d_surface_get_pitch(surface);
if (!rect)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment