wined3d: Pass correctly offset pointers to surface_cpu_blt_compressed().
This was debugged by Alexey Loukianov.
This commit is contained in:
parent
b39425f3cf
commit
29468906bb
|
@ -6620,6 +6620,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
|
||||||
const struct wined3d_format *src_format, *dst_format;
|
const struct wined3d_format *src_format, *dst_format;
|
||||||
struct wined3d_surface *orig_src = src_surface;
|
struct wined3d_surface *orig_src = src_surface;
|
||||||
struct wined3d_mapped_rect dst_map, src_map;
|
struct wined3d_mapped_rect dst_map, src_map;
|
||||||
|
const BYTE *sbase = NULL;
|
||||||
HRESULT hr = WINED3D_OK;
|
HRESULT hr = WINED3D_OK;
|
||||||
const BYTE *sbuf;
|
const BYTE *sbuf;
|
||||||
RECT xdst,xsrc;
|
RECT xdst,xsrc;
|
||||||
|
@ -6745,6 +6746,17 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
|
||||||
dstwidth = xdst.right - xdst.left;
|
dstwidth = xdst.right - xdst.left;
|
||||||
width = (xdst.right - xdst.left) * bpp;
|
width = (xdst.right - xdst.left) * bpp;
|
||||||
|
|
||||||
|
if (src_surface)
|
||||||
|
sbase = (BYTE *)src_map.data
|
||||||
|
+ ((xsrc.top / src_format->block_height) * src_map.row_pitch)
|
||||||
|
+ ((xsrc.left / src_format->block_width) * src_format->block_byte_count);
|
||||||
|
if (dst_rect && src_surface != dst_surface)
|
||||||
|
dbuf = dst_map.data;
|
||||||
|
else
|
||||||
|
dbuf = (BYTE *)dst_map.data
|
||||||
|
+ ((xdst.top / dst_format->block_height) * dst_map.row_pitch)
|
||||||
|
+ ((xdst.left / dst_format->block_width) * dst_format->block_byte_count);
|
||||||
|
|
||||||
if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS)
|
if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS)
|
||||||
{
|
{
|
||||||
TRACE("%s -> %s copy.\n", debug_d3dformat(src_format->id), debug_d3dformat(dst_format->id));
|
TRACE("%s -> %s copy.\n", debug_d3dformat(src_format->id), debug_d3dformat(dst_format->id));
|
||||||
|
@ -6770,17 +6782,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
|
||||||
goto release;
|
goto release;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = surface_cpu_blt_compressed(src_map.data, dst_map.data,
|
hr = surface_cpu_blt_compressed(sbase, dbuf,
|
||||||
src_map.row_pitch, dst_map.row_pitch, dstwidth, dstheight,
|
src_map.row_pitch, dst_map.row_pitch, dstwidth, dstheight,
|
||||||
src_format, flags, fx);
|
src_format, flags, fx);
|
||||||
goto release;
|
goto release;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst_rect && src_surface != dst_surface)
|
|
||||||
dbuf = dst_map.data;
|
|
||||||
else
|
|
||||||
dbuf = (BYTE *)dst_map.data + (xdst.top * dst_map.row_pitch) + (xdst.left * bpp);
|
|
||||||
|
|
||||||
/* First, all the 'source-less' blits */
|
/* First, all the 'source-less' blits */
|
||||||
if (flags & WINEDDBLT_COLORFILL)
|
if (flags & WINEDDBLT_COLORFILL)
|
||||||
{
|
{
|
||||||
|
@ -6820,7 +6827,6 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
|
||||||
/* Now the 'with source' blits. */
|
/* Now the 'with source' blits. */
|
||||||
if (src_surface)
|
if (src_surface)
|
||||||
{
|
{
|
||||||
const BYTE *sbase;
|
|
||||||
int sx, xinc, sy, yinc;
|
int sx, xinc, sy, yinc;
|
||||||
|
|
||||||
if (!dstwidth || !dstheight) /* Hmm... stupid program? */
|
if (!dstwidth || !dstheight) /* Hmm... stupid program? */
|
||||||
|
@ -6833,7 +6839,6 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
|
||||||
FIXME("Filter %s not supported in software blit.\n", debug_d3dtexturefiltertype(filter));
|
FIXME("Filter %s not supported in software blit.\n", debug_d3dtexturefiltertype(filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
sbase = (BYTE *)src_map.data + (xsrc.top * src_map.row_pitch) + xsrc.left * bpp;
|
|
||||||
xinc = (srcwidth << 16) / dstwidth;
|
xinc = (srcwidth << 16) / dstwidth;
|
||||||
yinc = (srcheight << 16) / dstheight;
|
yinc = (srcheight << 16) / dstheight;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue