Henri Verbeet : wined3d: Use the format info for doing compressed surface blits in BltFast().
Alexandre Julliard
julliard at winehq.org
Wed Jun 10 10:16:58 CDT 2009
Module: wine
Branch: master
Commit: e83fa982ca2b2686945f3cbeb0117a56703dc30b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e83fa982ca2b2686945f3cbeb0117a56703dc30b
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Wed Jun 10 09:44:05 2009 +0200
wined3d: Use the format info for doing compressed surface blits in BltFast().
---
dlls/wined3d/surface_base.c | 46 +++++++++---------------------------------
1 files changed, 10 insertions(+), 36 deletions(-)
diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c
index 50faf9a..407a6db 100644
--- a/dlls/wined3d/surface_base.c
+++ b/dlls/wined3d/surface_base.c
@@ -1650,65 +1650,39 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
dEntry = This->resource.format_desc;
}
- /* Handle first the FOURCC surfaces... */
- if (sEntry->Flags & dEntry->Flags & WINED3DFMT_FLAG_FOURCC)
+ /* Handle compressed surfaces first... */
+ if (sEntry->Flags & dEntry->Flags & WINED3DFMT_FLAG_COMPRESSED)
{
- UINT block_width;
- UINT block_height;
- UINT block_byte_size;
UINT row_block_count;
- TRACE("Fourcc -> Fourcc copy\n");
+ TRACE("compressed -> compressed copy\n");
if (trans)
- FIXME("trans arg not supported when a FOURCC surface is involved\n");
+ FIXME("trans arg not supported when a compressed surface is involved\n");
if (dstx || dsty)
FIXME("offset for destination surface is not supported\n");
if (Src->resource.format_desc->format != This->resource.format_desc->format)
{
- FIXME("FOURCC->FOURCC copy only supported for the same type of surface\n");
+ FIXME("compressed -> compressed copy only supported for the same type of surface\n");
ret = WINED3DERR_WRONGTEXTUREFORMAT;
goto error;
}
- if (This->resource.format_desc->format == WINED3DFMT_DXT1)
- {
- block_width = 4;
- block_height = 4;
- block_byte_size = 8;
- }
- else if (This->resource.format_desc->format == WINED3DFMT_DXT2
- || This->resource.format_desc->format == WINED3DFMT_DXT3
- || This->resource.format_desc->format == WINED3DFMT_DXT4
- || This->resource.format_desc->format == WINED3DFMT_DXT5)
- {
- block_width = 4;
- block_height = 4;
- block_byte_size = 16;
- }
- else
- {
- FIXME("Unsupported FourCC format %s.\n", debug_d3dformat(This->resource.format_desc->format));
- block_width = 1;
- block_height = 1;
- block_byte_size = This->resource.format_desc->byte_count;
- }
-
- row_block_count = (w + block_width - 1) / block_width;
- for (y = 0; y < h; y += block_height)
+ row_block_count = (w + dEntry->block_width - 1) / dEntry->block_width;
+ for (y = 0; y < h; y += dEntry->block_height)
{
- memcpy(dbuf, sbuf, row_block_count * block_byte_size);
+ memcpy(dbuf, sbuf, row_block_count * dEntry->block_byte_count);
dbuf += dlock.Pitch;
sbuf += slock.Pitch;
}
goto error;
}
- if ((sEntry->Flags & WINED3DFMT_FLAG_FOURCC) && !(dEntry->Flags & WINED3DFMT_FLAG_FOURCC))
+ if ((sEntry->Flags & WINED3DFMT_FLAG_COMPRESSED) && !(dEntry->Flags & WINED3DFMT_FLAG_COMPRESSED))
{
/* TODO: Use the libtxc_dxtn.so shared library to do
* software decompression
*/
- ERR("DXTC decompression not supported by now\n");
+ ERR("Software decompression not supported.\n");
goto error;
}
More information about the wine-cvs
mailing list