You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Update DXTn patches to better handle when libtxc_dxtn is missing or support is not compiled in.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
From 0808d72ca1d94c68fcf07379195e086d24383d43 Mon Sep 17 00:00:00 2001
|
||||
From 5dc54490906f945778a858ecb757cf39500d0b40 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sat, 1 Nov 2014 13:08:05 +0100
|
||||
Subject: d3dx9_36: Add dxtn support.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/Makefile.in | 2 +-
|
||||
dlls/d3dx9_36/surface.c | 101 ++++++++++++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 95 insertions(+), 8 deletions(-)
|
||||
dlls/d3dx9_36/surface.c | 104 ++++++++++++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 98 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
|
||||
index 5958c57..aa387b5 100644
|
||||
@@ -21,7 +21,7 @@ index 5958c57..aa387b5 100644
|
||||
C_SRCS = \
|
||||
core.c \
|
||||
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
|
||||
index f187031..9a1e1cb 100644
|
||||
index f187031..70dc0cd 100644
|
||||
--- a/dlls/d3dx9_36/surface.c
|
||||
+++ b/dlls/d3dx9_36/surface.c
|
||||
@@ -18,6 +18,7 @@
|
||||
@@ -41,22 +41,25 @@ index f187031..9a1e1cb 100644
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
|
||||
|
||||
|
||||
@@ -1716,6 +1719,24 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
|
||||
@@ -1716,6 +1719,27 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
|
||||
}
|
||||
}
|
||||
|
||||
+typedef BOOL (*dxtn_conversion_func)(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out,
|
||||
+ enum wined3d_format_id format, unsigned int w, unsigned int h);
|
||||
+ enum wined3d_format_id format, unsigned int w, unsigned int h);
|
||||
+
|
||||
+static dxtn_conversion_func get_dxtn_conversion_func(D3DFORMAT format, BOOL encode)
|
||||
+{
|
||||
+ switch (format)
|
||||
+ {
|
||||
+ case D3DFMT_DXT1:
|
||||
+ if (!wined3d_dxtn_supported()) return NULL;
|
||||
+ return encode ? wined3d_dxt1_encode : wined3d_dxt1_decode;
|
||||
+ case D3DFMT_DXT3:
|
||||
+ if (!wined3d_dxtn_supported()) return NULL;
|
||||
+ return encode ? wined3d_dxt3_encode : wined3d_dxt3_decode;
|
||||
+ case D3DFMT_DXT5:
|
||||
+ if (!wined3d_dxtn_supported()) return NULL;
|
||||
+ return encode ? wined3d_dxt5_encode : wined3d_dxt5_decode;
|
||||
+ default:
|
||||
+ return NULL;
|
||||
@@ -66,7 +69,7 @@ index f187031..9a1e1cb 100644
|
||||
/************************************************************
|
||||
* D3DXLoadSurfaceFromMemory
|
||||
*
|
||||
@@ -1757,6 +1778,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
@@ -1757,6 +1781,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
D3DSURFACE_DESC surfdesc;
|
||||
D3DLOCKED_RECT lockrect;
|
||||
struct volume src_size, dst_size;
|
||||
@@ -74,7 +77,7 @@ index f187031..9a1e1cb 100644
|
||||
|
||||
TRACE("(%p, %p, %s, %p, %#x, %u, %p, %s %#x, 0x%08x)\n",
|
||||
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_memory, src_format,
|
||||
@@ -1838,8 +1860,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
@@ -1838,8 +1863,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
}
|
||||
else /* Stretching or format conversion. */
|
||||
{
|
||||
@@ -92,7 +95,7 @@ index f187031..9a1e1cb 100644
|
||||
{
|
||||
FIXME("Format conversion missing %#x -> %#x\n", src_format, surfdesc.Format);
|
||||
return E_NOTIMPL;
|
||||
@@ -1848,10 +1877,52 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
@@ -1848,10 +1880,52 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
if (FAILED(IDirect3DSurface9_LockRect(dst_surface, &lockrect, dst_rect, 0)))
|
||||
return D3DXERR_INVALIDDATA;
|
||||
|
||||
@@ -147,7 +150,7 @@ index f187031..9a1e1cb 100644
|
||||
}
|
||||
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
|
||||
{
|
||||
@@ -1860,14 +1931,30 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
@@ -1860,14 +1934,30 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
||||
|
||||
/* Always apply a point filter until D3DX_FILTER_LINEAR,
|
||||
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
|
||||
@@ -182,5 +185,5 @@ index f187031..9a1e1cb 100644
|
||||
|
||||
/************************************************************
|
||||
--
|
||||
2.1.3
|
||||
2.2.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user