Removed patches to use interlocked functions for library refcounts (accepted upstream).

This commit is contained in:
Sebastian Lackner 2015-03-02 16:17:41 +01:00
parent 3efff4cb88
commit e86c1653d8
10 changed files with 112 additions and 696 deletions

View File

@ -1,79 +0,0 @@
From d8497e4ebc1fb5a3b703e4dd4474c65bbb25796d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 1 Mar 2015 03:46:06 +0100
Subject: browseui: Always use interlocked functions when accessing variable
BROWSEUI_refCount.
---
dlls/browseui/browseui_main.c | 4 ++--
dlls/browseui/compcatcachedaemon.c | 4 ++--
dlls/browseui/progressdlg.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/browseui/browseui_main.c b/dlls/browseui/browseui_main.c
index 78ce326..f509ee5 100644
--- a/dlls/browseui/browseui_main.c
+++ b/dlls/browseui/browseui_main.c
@@ -74,7 +74,7 @@ static void ClassFactory_Destructor(ClassFactory *This)
{
TRACE("Destroying class factory %p\n", This);
heap_free(This);
- BROWSEUI_refCount--;
+ InterlockedDecrement(&BROWSEUI_refCount);
}
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppvOut)
@@ -154,7 +154,7 @@ static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut)
This->ctor = ctor;
*ppvOut = This;
TRACE("Created class factory %p\n", This);
- BROWSEUI_refCount++;
+ InterlockedIncrement(&BROWSEUI_refCount);
return S_OK;
}
diff --git a/dlls/browseui/compcatcachedaemon.c b/dlls/browseui/compcatcachedaemon.c
index 0acb4ec..a5addd2 100644
--- a/dlls/browseui/compcatcachedaemon.c
+++ b/dlls/browseui/compcatcachedaemon.c
@@ -60,7 +60,7 @@ static void CompCatCacheDaemon_Destructor(CompCatCacheDaemon *This)
This->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->cs);
heap_free(This);
- BROWSEUI_refCount--;
+ InterlockedDecrement(&BROWSEUI_refCount);
}
static HRESULT WINAPI CompCatCacheDaemon_QueryInterface(IRunnableTask *iface, REFIID iid, LPVOID *ppvOut)
@@ -159,6 +159,6 @@ HRESULT CompCatCacheDaemon_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
TRACE("returning %p\n", This);
*ppOut = (IUnknown *)This;
- BROWSEUI_refCount++;
+ InterlockedIncrement(&BROWSEUI_refCount);
return S_OK;
}
diff --git a/dlls/browseui/progressdlg.c b/dlls/browseui/progressdlg.c
index 598197b..e61a4cc 100644
--- a/dlls/browseui/progressdlg.c
+++ b/dlls/browseui/progressdlg.c
@@ -268,7 +268,7 @@ static void ProgressDialog_Destructor(ProgressDialog *This)
This->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->cs);
heap_free(This);
- BROWSEUI_refCount--;
+ InterlockedDecrement(&BROWSEUI_refCount);
}
static HRESULT WINAPI ProgressDialog_QueryInterface(IProgressDialog *iface, REFIID iid, LPVOID *ppvOut)
@@ -574,6 +574,6 @@ HRESULT ProgressDialog_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
TRACE("returning %p\n", This);
*ppOut = (IUnknown *)This;
- BROWSEUI_refCount++;
+ InterlockedIncrement(&BROWSEUI_refCount);
return S_OK;
}
--
2.3.0

View File

@ -1,449 +0,0 @@
From 59212bd36e71d8a997dd86efbf0f1cdd38952dc4 Mon Sep 17 00:00:00 2001
From: Amine Khaldi <amine.khaldi@reactos.org>
Date: Sat, 28 Feb 2015 09:22:59 +0100
Subject: include: Correct DDSCAPS2 and DDSURFACEDESC2 structures and their
uses.
---
dlls/ddraw/ddraw.c | 4 ++--
dlls/ddraw/device.c | 2 +-
dlls/ddraw/surface.c | 24 ++++++++++++------------
dlls/ddraw/tests/ddraw4.c | 16 ++++++++--------
dlls/ddraw/tests/ddraw7.c | 18 +++++++++---------
dlls/ddraw/utils.c | 10 +++++-----
dlls/ddrawex/ddraw.c | 4 ++--
dlls/dxdiagn/provider.c | 4 ++--
include/ddraw.h | 10 ++++++++--
9 files changed, 49 insertions(+), 43 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index fcbc3bf..02b2f6e 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -1438,7 +1438,7 @@ static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DD
DDCAPS caps;
WINED3DCAPS winecaps;
HRESULT hr;
- DDSCAPS2 ddscaps = {0, 0, 0, 0};
+ DDSCAPS2 ddscaps = {0, 0, 0, {0}};
TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, DriverCaps, HELCaps);
@@ -3010,7 +3010,7 @@ static BOOL ddraw_match_surface_desc(const DDSURFACEDESC2 *requested, const DDSU
static const struct compare_info compare[] =
{
CMP(ALPHABITDEPTH, dwAlphaBitDepth),
- CMP(BACKBUFFERCOUNT, dwBackBufferCount),
+ CMP(BACKBUFFERCOUNT, u5.dwBackBufferCount),
CMP(CAPS, ddsCaps),
CMP(CKDESTBLT, ddckCKDestBlt),
CMP(CKDESTOVERLAY, u3 /* ddckCKDestOverlay */),
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 5406fb9..f0dcf16 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -6747,7 +6747,7 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device
{
IDirectDrawSurface7 *depthStencil = NULL;
IDirectDrawSurface7 *render_target;
- static DDSCAPS2 depthcaps = { DDSCAPS_ZBUFFER, 0, 0, 0 };
+ static DDSCAPS2 depthcaps = { DDSCAPS_ZBUFFER, 0, 0, {0} };
struct ddraw_surface *dsi;
if (device->rt_iface && SUCCEEDED(IUnknown_QueryInterface(device->rt_iface,
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index a387d12..331d2bb 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -745,14 +745,14 @@ static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *ifa
our_caps.dwCaps = Caps->dwCaps;
our_caps.dwCaps2 = 0;
our_caps.dwCaps3 = 0;
- our_caps.dwCaps4 = 0;
+ our_caps.u1.dwCaps4 = 0;
}
else
{
our_caps = *Caps;
}
- TRACE("(%p): Looking for caps: %x,%x,%x,%x\n", This, our_caps.dwCaps, our_caps.dwCaps2, our_caps.dwCaps3, our_caps.dwCaps4); /* FIXME: Better debugging */
+ TRACE("(%p): Looking for caps: %x,%x,%x,%x\n", This, our_caps.dwCaps, our_caps.dwCaps2, our_caps.dwCaps3, our_caps.u1.dwCaps4); /* FIXME: Better debugging */
for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
{
@@ -763,7 +763,7 @@ static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *ifa
surf->surface_desc.ddsCaps.dwCaps,
surf->surface_desc.ddsCaps.dwCaps2,
surf->surface_desc.ddsCaps.dwCaps3,
- surf->surface_desc.ddsCaps.dwCaps4);
+ surf->surface_desc.ddsCaps.u1.dwCaps4);
if (((surf->surface_desc.ddsCaps.dwCaps & our_caps.dwCaps) == our_caps.dwCaps) &&
((surf->surface_desc.ddsCaps.dwCaps2 & our_caps.dwCaps2) == our_caps.dwCaps2)) {
@@ -793,7 +793,7 @@ static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *ifa
surf->surface_desc.ddsCaps.dwCaps,
surf->surface_desc.ddsCaps.dwCaps2,
surf->surface_desc.ddsCaps.dwCaps3,
- surf->surface_desc.ddsCaps.dwCaps4);
+ surf->surface_desc.ddsCaps.u1.dwCaps4);
if (((surf->surface_desc.ddsCaps.dwCaps & our_caps.dwCaps) == our_caps.dwCaps) &&
((surf->surface_desc.ddsCaps.dwCaps2 & our_caps.dwCaps2) == our_caps.dwCaps2)) {
@@ -853,7 +853,7 @@ static HRESULT WINAPI ddraw_surface3_GetAttachedSurface(IDirectDrawSurface3 *ifa
caps2.dwCaps = caps->dwCaps;
caps2.dwCaps2 = 0;
caps2.dwCaps3 = 0;
- caps2.dwCaps4 = 0;
+ caps2.u1.dwCaps4 = 0;
hr = ddraw_surface7_GetAttachedSurface(&surface->IDirectDrawSurface7_iface,
&caps2, &attachment7);
@@ -884,7 +884,7 @@ static HRESULT WINAPI ddraw_surface2_GetAttachedSurface(IDirectDrawSurface2 *ifa
caps2.dwCaps = caps->dwCaps;
caps2.dwCaps2 = 0;
caps2.dwCaps3 = 0;
- caps2.dwCaps4 = 0;
+ caps2.u1.dwCaps4 = 0;
hr = ddraw_surface7_GetAttachedSurface(&surface->IDirectDrawSurface7_iface,
&caps2, &attachment7);
@@ -915,7 +915,7 @@ static HRESULT WINAPI ddraw_surface1_GetAttachedSurface(IDirectDrawSurface *ifac
caps2.dwCaps = caps->dwCaps;
caps2.dwCaps2 = 0;
caps2.dwCaps3 = 0;
- caps2.dwCaps4 = 0;
+ caps2.u1.dwCaps4 = 0;
hr = ddraw_surface7_GetAttachedSurface(&surface->IDirectDrawSurface7_iface,
&caps2, &attachment7);
@@ -1214,7 +1214,7 @@ static HRESULT WINAPI ddraw_surface7_Flip(IDirectDrawSurface7 *iface, IDirectDra
struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface7(src);
struct wined3d_rendertarget_view *tmp_rtv, *src_rtv, *rtv;
struct ddraw_texture *ddraw_texture, *prev_ddraw_texture;
- DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, {0}};
struct wined3d_texture *texture;
IDirectDrawSurface7 *current;
struct wined3d_surface *tmp;
@@ -4985,7 +4985,7 @@ static HRESULT WINAPI d3d_texture1_GetHandle(IDirect3DTexture *iface,
static struct ddraw_surface *get_sub_mimaplevel(struct ddraw_surface *surface)
{
/* Now go down the mipmap chain to the next surface */
- static DDSCAPS2 mipmap_caps = { DDSCAPS_MIPMAP | DDSCAPS_TEXTURE, 0, 0, 0 };
+ static DDSCAPS2 mipmap_caps = { DDSCAPS_MIPMAP | DDSCAPS_TEXTURE, 0, 0, {0} };
IDirectDrawSurface7 *next_level;
HRESULT hr;
@@ -5652,7 +5652,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return DDERR_INVALIDCAPS;
}
- if (!(desc->dwFlags & DDSD_BACKBUFFERCOUNT) || !desc->dwBackBufferCount)
+ if (!(desc->dwFlags & DDSD_BACKBUFFERCOUNT) || !desc->u5.dwBackBufferCount)
{
WARN("Tried to create a flippable primary surface without any back buffers.\n");
HeapFree(GetProcessHeap(), 0, texture);
@@ -6079,7 +6079,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
if (desc->dwFlags & DDSD_BACKBUFFERCOUNT)
{
- unsigned int count = desc->dwBackBufferCount;
+ unsigned int count = desc->u5.dwBackBufferCount;
struct ddraw_surface *last = root;
attach = &last->complex_array[0];
@@ -6101,7 +6101,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
| DDSCAPS_BACKBUFFER);
if (!i)
desc->ddsCaps.dwCaps |= DDSCAPS_BACKBUFFER;
- desc->dwBackBufferCount = 0;
+ desc->u5.dwBackBufferCount = 0;
if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, &wined3d_desc, 1,
WINED3D_SURFACE_PIN_SYSMEM, NULL, texture, &ddraw_texture_wined3d_parent_ops, &wined3d_texture)))
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 16a644f..e5c808a 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -141,7 +141,7 @@ static void destroy_window_thread(struct create_window_thread_param *p)
static IDirectDrawSurface4 *get_depth_stencil(IDirect3DDevice3 *device)
{
IDirectDrawSurface4 *rt, *ret;
- DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, {0}};
HRESULT hr;
hr = IDirect3DDevice3_GetRenderTarget(device, &rt);
@@ -1921,7 +1921,7 @@ static void test_ck_default(void)
static void test_ck_complex(void)
{
IDirectDrawSurface4 *surface, *mipmap, *tmp;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DDSURFACEDESC2 surface_desc;
IDirect3DDevice3 *device;
DDCOLORKEY color_key;
@@ -5502,7 +5502,7 @@ static void test_flip(void)
{
const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
IDirectDrawSurface4 *primary, *backbuffer1, *backbuffer2, *backbuffer3, *surface;
- DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, {0}};
DDSURFACEDESC2 surface_desc;
BOOL sysmem_primary;
IDirectDraw4 *ddraw;
@@ -6122,7 +6122,7 @@ static void test_sysmem_overlay(void)
static void test_primary_palette(void)
{
- DDSCAPS2 surface_caps = {DDSCAPS_FLIP, 0, 0, 0};
+ DDSCAPS2 surface_caps = {DDSCAPS_FLIP, 0, 0, {0}};
IDirectDrawSurface4 *primary, *backbuffer;
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette, *tmp;
@@ -6249,7 +6249,7 @@ static void test_surface_attachment(void)
{
IDirectDrawSurface4 *surface1, *surface2, *surface3, *surface4;
IDirectDrawSurface *surface1v1, *surface2v1;
- DDSCAPS2 caps = {DDSCAPS_TEXTURE, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_TEXTURE, 0, 0, {0}};
DDSURFACEDESC2 surface_desc;
IDirectDraw4 *ddraw;
UINT surface_count;
@@ -6513,7 +6513,7 @@ static void test_private_data(void)
DWORD size = sizeof(ptr);
HRESULT hr;
HWND window;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DWORD data[] = {1, 2, 3, 4};
DDCAPS hal_caps;
static const GUID ddraw_private_data_test_guid =
@@ -6958,7 +6958,7 @@ static void test_mipmap_lock(void)
ULONG refcount;
HWND window;
HRESULT hr;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DDCAPS hal_caps;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
@@ -7020,7 +7020,7 @@ static void test_palette_complex(void)
ULONG refcount;
HWND window;
HRESULT hr;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DDCAPS hal_caps;
PALETTEENTRY palette_entries[256];
unsigned int i;
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 90ea739..c558385 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -155,7 +155,7 @@ static void destroy_window_thread(struct create_window_thread_param *p)
static IDirectDrawSurface7 *get_depth_stencil(IDirect3DDevice7 *device)
{
IDirectDrawSurface7 *rt, *ret;
- DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, {0}};
HRESULT hr;
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
@@ -1613,7 +1613,7 @@ static void test_ck_default(void)
static void test_ck_complex(void)
{
IDirectDrawSurface7 *surface, *mipmap, *tmp;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DDSURFACEDESC2 surface_desc;
IDirect3DDevice7 *device;
DDCOLORKEY color_key;
@@ -5343,7 +5343,7 @@ static void test_flip(void)
{
const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
IDirectDrawSurface7 *primary, *backbuffer1, *backbuffer2, *backbuffer3, *surface;
- DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_FLIP, 0, 0, {0}};
DDSURFACEDESC2 surface_desc;
BOOL sysmem_primary;
IDirectDraw7 *ddraw;
@@ -5962,7 +5962,7 @@ static void test_sysmem_overlay(void)
static void test_primary_palette(void)
{
- DDSCAPS2 surface_caps = {DDSCAPS_FLIP, 0, 0, 0};
+ DDSCAPS2 surface_caps = {DDSCAPS_FLIP, 0, 0, {0}};
IDirectDrawSurface7 *primary, *backbuffer;
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette, *tmp;
@@ -6089,7 +6089,7 @@ static void test_surface_attachment(void)
{
IDirectDrawSurface7 *surface1, *surface2, *surface3, *surface4;
IDirectDrawSurface *surface1v1, *surface2v1;
- DDSCAPS2 caps = {DDSCAPS_TEXTURE, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_TEXTURE, 0, 0, {0}};
DDSURFACEDESC2 surface_desc;
IDirectDraw7 *ddraw;
UINT surface_count;
@@ -6335,7 +6335,7 @@ static void test_private_data(void)
DWORD size = sizeof(ptr);
HRESULT hr;
HWND window;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DWORD data[] = {1, 2, 3, 4};
DDCAPS hal_caps;
static const GUID ddraw_private_data_test_guid =
@@ -6780,7 +6780,7 @@ static void test_mipmap_lock(void)
ULONG refcount;
HWND window;
HRESULT hr;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DDCAPS hal_caps;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
@@ -6842,7 +6842,7 @@ static void test_palette_complex(void)
ULONG refcount;
HWND window;
HRESULT hr;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DDCAPS hal_caps;
PALETTEENTRY palette_entries[256];
unsigned int i;
@@ -7746,7 +7746,7 @@ static void test_resource_priority(void)
ULONG refcount;
HWND window;
HRESULT hr;
- DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0};
+ DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, {0}};
DDCAPS hal_caps;
DWORD needed_caps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_MIPMAP;
unsigned int i;
diff --git a/dlls/ddraw/utils.c b/dlls/ddraw/utils.c
index ebd355b..ad271bc 100644
--- a/dlls/ddraw/utils.c
+++ b/dlls/ddraw/utils.c
@@ -686,7 +686,7 @@ DDRAW_dump_DDSCAPS(const DDSCAPS *in)
in_bis.dwCaps = in->dwCaps;
in_bis.dwCaps2 = 0;
in_bis.dwCaps3 = 0;
- in_bis.dwCaps4 = 0;
+ in_bis.u1.dwCaps4 = 0;
DDRAW_dump_DDSCAPS2(&in_bis);
}
@@ -776,7 +776,7 @@ void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd)
ME(DDSD_WIDTH, DDRAW_dump_DWORD, dwWidth),
ME(DDSD_PITCH, DDRAW_dump_DWORD, u1 /* lPitch */),
ME(DDSD_LINEARSIZE, DDRAW_dump_DWORD, u1 /* dwLinearSize */),
- ME(DDSD_BACKBUFFERCOUNT, DDRAW_dump_DWORD, dwBackBufferCount),
+ ME(DDSD_BACKBUFFERCOUNT, DDRAW_dump_DWORD, u5.dwBackBufferCount),
ME(DDSD_MIPMAPCOUNT, DDRAW_dump_DWORD, u2 /* dwMipMapCount */),
ME(DDSD_ZBUFFERBITDEPTH, DDRAW_dump_DWORD, u2 /* dwZBufferBitDepth */), /* This is for 'old-style' D3D */
ME(DDSD_REFRESHRATE, DDRAW_dump_DWORD, u2 /* dwRefreshRate */),
@@ -862,7 +862,7 @@ void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS* pIn, DDSCAPS2* pOut)
pOut->dwCaps = pIn->dwCaps;
pOut->dwCaps2 = 0;
pOut->dwCaps3 = 0;
- pOut->dwCaps4 = 0;
+ pOut->u1.dwCaps4 = 0;
}
void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2* pIn, DDDEVICEIDENTIFIER* pOut)
@@ -1147,7 +1147,7 @@ void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out)
/* ddsCaps is read even without DDSD_CAPS set. See dsurface:no_ddsd_caps_test */
out->ddsCaps.dwCaps = in->ddsCaps.dwCaps;
if (in->dwFlags & DDSD_PITCH) out->u1.lPitch = in->u1.lPitch;
- if (in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->dwBackBufferCount;
+ if (in->dwFlags & DDSD_BACKBUFFERCOUNT) out->u5.dwBackBufferCount = in->dwBackBufferCount;
if (in->dwFlags & DDSD_ALPHABITDEPTH) out->dwAlphaBitDepth = in->dwAlphaBitDepth;
/* DDraw(native, and wine) does not set the DDSD_LPSURFACE, so always copy */
out->lpSurface = in->lpSurface;
@@ -1188,7 +1188,7 @@ void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out)
/* ddsCaps is read even without DDSD_CAPS set. See dsurface:no_ddsd_caps_test */
out->ddsCaps.dwCaps = in->ddsCaps.dwCaps;
if (in->dwFlags & DDSD_PITCH) out->u1.lPitch = in->u1.lPitch;
- if (in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->dwBackBufferCount;
+ if (in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->u5.dwBackBufferCount;
if (in->dwFlags & DDSD_ZBUFFERBITDEPTH) out->u2.dwZBufferBitDepth = in->u2.dwMipMapCount; /* same union */
if (in->dwFlags & DDSD_ALPHABITDEPTH) out->dwAlphaBitDepth = in->dwAlphaBitDepth;
/* DDraw(native, and wine) does not set the DDSD_LPSURFACE, so always copy */
diff --git a/dlls/ddrawex/ddraw.c b/dlls/ddrawex/ddraw.c
index b32f726..e2df885 100644
--- a/dlls/ddrawex/ddraw.c
+++ b/dlls/ddrawex/ddraw.c
@@ -390,7 +390,7 @@ void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out)
if(in->dwFlags & DDSD_PIXELFORMAT) out->u4.ddpfPixelFormat = in->ddpfPixelFormat;
if(in->dwFlags & DDSD_CAPS) out->ddsCaps.dwCaps = in->ddsCaps.dwCaps;
if(in->dwFlags & DDSD_PITCH) out->u1.lPitch = in->u1.lPitch;
- if(in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->dwBackBufferCount;
+ if(in->dwFlags & DDSD_BACKBUFFERCOUNT) out->u5.dwBackBufferCount = in->dwBackBufferCount;
if(in->dwFlags & DDSD_ZBUFFERBITDEPTH) out->u2.dwMipMapCount = in->u2.dwZBufferBitDepth; /* same union */
if(in->dwFlags & DDSD_ALPHABITDEPTH) out->dwAlphaBitDepth = in->dwAlphaBitDepth;
/* DDraw(native, and wine) does not set the DDSD_LPSURFACE, so always copy */
@@ -417,7 +417,7 @@ void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out)
if(in->dwFlags & DDSD_PIXELFORMAT) out->ddpfPixelFormat = in->u4.ddpfPixelFormat;
if(in->dwFlags & DDSD_CAPS) out->ddsCaps.dwCaps = in->ddsCaps.dwCaps;
if(in->dwFlags & DDSD_PITCH) out->u1.lPitch = in->u1.lPitch;
- if(in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->dwBackBufferCount;
+ if(in->dwFlags & DDSD_BACKBUFFERCOUNT) out->dwBackBufferCount = in->u5.dwBackBufferCount;
if(in->dwFlags & DDSD_ZBUFFERBITDEPTH) out->u2.dwZBufferBitDepth = in->u2.dwMipMapCount; /* same union */
if(in->dwFlags & DDSD_ALPHABITDEPTH) out->dwAlphaBitDepth = in->dwAlphaBitDepth;
/* DDraw(native, and wine) does not set the DDSD_LPSURFACE, so always copy */
diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c
index 451270c..5831488 100644
--- a/dlls/dxdiagn/provider.c
+++ b/dlls/dxdiagn/provider.c
@@ -856,7 +856,7 @@ static BOOL get_texture_memory(GUID *adapter, DWORD *available_mem)
if (SUCCEEDED(hr))
{
dd_caps.dwCaps = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY;
- dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.dwCaps4 = 0;
+ dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.u1.dwCaps4 = 0;
hr = IDirectDraw7_GetAvailableVidMem(pDirectDraw, &dd_caps, available_mem, NULL);
IDirectDraw7_Release(pDirectDraw);
if (SUCCEEDED(hr))
@@ -1112,7 +1112,7 @@ static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container
return S_OK;
dd_caps.dwCaps = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY;
- dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.dwCaps4 = 0;
+ dd_caps.dwCaps2 = dd_caps.dwCaps3 = dd_caps.u1.dwCaps4 = 0;
hr = IDirectDraw7_GetAvailableVidMem(pDirectDraw, &dd_caps, &tmp, NULL);
if (SUCCEEDED(hr))
{
diff --git a/include/ddraw.h b/include/ddraw.h
index 22be0eb..f94abe3 100644
--- a/include/ddraw.h
+++ b/include/ddraw.h
@@ -371,7 +371,10 @@ typedef struct _DDSCAPS2 {
DWORD dwCaps; /* capabilities of surface wanted */
DWORD dwCaps2; /* additional capabilities */
DWORD dwCaps3; /* reserved capabilities */
- DWORD dwCaps4; /* more reserved capabilities */
+ union {
+ DWORD dwCaps4; /* more reserved capabilities */
+ DWORD dwVolumeDepth;
+ } DUMMYUNIONNAME1;
} DDSCAPS2,*LPDDSCAPS2;
#define DD_ROP_SPACE (256/32) /* space required to store ROP array */
@@ -1001,7 +1004,10 @@ typedef struct _DDSURFACEDESC2
LONG lPitch; /*10: distance to start of next line (return value only)*/
DWORD dwLinearSize; /*10: formless late-allocated optimized surface size */
} DUMMYUNIONNAME1;
- DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
+ union {
+ DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
+ DWORD dwDepth;
+ } DUMMYUNIONNAME5;
union {
DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/
DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
--
2.3.0

View File

@ -69,7 +69,7 @@ index 01cef2c..a20c3e8 100644
*/
static NTSTATUS FILE_AsyncReadService(void *user, PIO_STATUS_BLOCK iosb, NTSTATUS status, void **apc)
{
async_fileio_read *fileio = user;
struct async_fileio_read *fileio = user;
- int fd, needs_close, result;
+ int fd, needs_close;
+ enum server_fd_type type;

View File

@ -58,7 +58,7 @@ index 8de4b98..e8a1066 100644
@@ -933,7 +964,7 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
static NTSTATUS FILE_AsyncWriteService(void *user, IO_STATUS_BLOCK *iosb, NTSTATUS status, void **apc)
{
async_fileio_write *fileio = user;
struct async_fileio_write *fileio = user;
- int result, fd, needs_close;
+ int fd, needs_close;
enum server_fd_type type;

View File

@ -1,35 +0,0 @@
From 4bcc72aa747a76c9300fbbd59a3c629206a7a554 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 1 Mar 2015 05:05:04 +0100
Subject: msctf: Always use interlocked functions when accessing
MSCTF_refCount.
---
dlls/msctf/msctf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c
index 78992f7..231246a 100644
--- a/dlls/msctf/msctf.c
+++ b/dlls/msctf/msctf.c
@@ -110,7 +110,7 @@ static void ClassFactory_Destructor(ClassFactory *This)
{
TRACE("Destroying class factory %p\n", This);
HeapFree(GetProcessHeap(),0,This);
- MSCTF_refCount--;
+ InterlockedDecrement(&MSCTF_refCount);
}
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppvOut)
@@ -190,7 +190,7 @@ static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut)
This->ctor = ctor;
*ppvOut = This;
TRACE("Created class factory %p\n", This);
- MSCTF_refCount++;
+ InterlockedIncrement(&MSCTF_refCount);
return S_OK;
}
--
2.3.0

View File

@ -99,7 +99,6 @@ patch_enable_all ()
enable_gdiplus_GdipCreateRegionRgnData="$1"
enable_imagehlp_BindImageEx="$1"
enable_include_Winetest="$1"
enable_include_ddraw="$1"
enable_iphlpapi_TCP_Table="$1"
enable_kernel32_Console_Handles="$1"
enable_kernel32_CopyFileEx="$1"
@ -339,9 +338,6 @@ patch_enable ()
include-Winetest)
enable_include_Winetest="$2"
;;
include-ddraw)
enable_include_ddraw="$2"
;;
iphlpapi-TCP_Table)
enable_iphlpapi_TCP_Table="$2"
;;
@ -1252,13 +1248,11 @@ fi
# Patchset browseui-Race_Conditions
# |
# | Modified files:
# | * dlls/browseui/browseui_main.c, dlls/browseui/compcatcachedaemon.c, dlls/browseui/progressdlg.c
# | * dlls/browseui/progressdlg.c
# |
if test "$enable_browseui_Race_Conditions" -eq 1; then
patch_apply browseui-Race_Conditions/0001-browseui-Always-use-interlocked-functions-when-acces.patch
patch_apply browseui-Race_Conditions/0002-browseui-Avoid-race-conditions-when-progress-dialog-.patch
patch_apply browseui-Race_Conditions/0001-browseui-Avoid-race-conditions-when-progress-dialog-.patch
(
echo '+ { "Sebastian Lackner", "browseui: Always use interlocked functions when accessing variable BROWSEUI_refCount.", 1 },';
echo '+ { "Sebastian Lackner", "browseui: Avoid race-conditions when progress dialog is released before thread terminates.", 1 },';
) >> "$patchlist"
fi
@ -1638,6 +1632,18 @@ if test "$enable_dxgi_GetDesc" -eq 1; then
) >> "$patchlist"
fi
# Patchset makedep-PARENTSPEC
# |
# | Modified files:
# | * tools/makedep.c
# |
if test "$enable_makedep_PARENTSPEC" -eq 1; then
patch_apply makedep-PARENTSPEC/0001-makedep-Add-support-for-PARENTSPEC-Makefile-variable.patch
(
echo '+ { "Sebastian Lackner", "makedep: Add support for PARENTSPEC Makefile variable.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-DllRedirects
# |
# | Modified files:
@ -1658,18 +1664,6 @@ if test "$enable_ntdll_DllRedirects" -eq 1; then
) >> "$patchlist"
fi
# Patchset makedep-PARENTSPEC
# |
# | Modified files:
# | * tools/makedep.c
# |
if test "$enable_makedep_PARENTSPEC" -eq 1; then
patch_apply makedep-PARENTSPEC/0001-makedep-Add-support-for-PARENTSPEC-Makefile-variable.patch
(
echo '+ { "Sebastian Lackner", "makedep: Add support for PARENTSPEC Makefile variable.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-CSMT_Helper
# |
# | Modified files:
@ -2262,19 +2256,6 @@ if test "$enable_include_Winetest" -eq 1; then
) >> "$patchlist"
fi
# Patchset include-ddraw
# |
# | Modified files:
# | * dlls/ddraw/ddraw.c, dlls/ddraw/device.c, dlls/ddraw/surface.c, dlls/ddraw/tests/ddraw4.c, dlls/ddraw/tests/ddraw7.c,
# | dlls/ddraw/utils.c, dlls/ddrawex/ddraw.c, dlls/dxdiagn/provider.c, include/ddraw.h
# |
if test "$enable_include_ddraw" -eq 1; then
patch_apply include-ddraw/0001-include-Correct-DDSCAPS2-and-DDSURFACEDESC2-structur.patch
(
echo '+ { "Amine Khaldi", "include: Correct DDSCAPS2 and DDSURFACEDESC2 structures and their uses.", 1 },';
) >> "$patchlist"
fi
# Patchset iphlpapi-TCP_Table
# |
# | This patchset fixes the following Wine bugs:
@ -2596,10 +2577,8 @@ fi
# | * dlls/msctf/msctf.c
# |
if test "$enable_msctf_DllCanUnloadNow" -eq 1; then
patch_apply msctf-DllCanUnloadNow/0001-msctf-Always-use-interlocked-functions-when-accessin.patch
patch_apply msctf-DllCanUnloadNow/0002-msctf-Avoid-unloading-library-while-textservices-are.patch
patch_apply msctf-DllCanUnloadNow/0001-msctf-Avoid-unloading-library-while-textservices-are.patch
(
echo '+ { "Sebastian Lackner", "msctf: Always use interlocked functions when accessing MSCTF_refCount.", 1 },';
echo '+ { "Sebastian Lackner", "msctf: Avoid unloading library while textservices are activated.", 1 },';
) >> "$patchlist"
fi

View File

@ -149,7 +149,7 @@ index 62d7880..ee40e39 100644
- args[0] = (DWORD_PTR)szDir;
- FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
- szText, 0, 0, szBuffer, sizeof(szBuffer), (__ms_va_list*)args);
- szText, 0, 0, szBuffer, sizeof(szBuffer)/sizeof(szBuffer[0]), (__ms_va_list*)args);
- hIcon = LoadIconW(ids.hIconInstance, (LPWSTR)MAKEINTRESOURCE(ids.icon_resource_id));
+ LoadStringW(shell32_hInstance, ids.caption_resource_id, szCaption, sizeof(szCaption)/sizeof(WCHAR));
+ LoadStringW(shell32_hInstance, ids.text_resource_id, szText, sizeof(szText)/sizeof(WCHAR));
@ -166,7 +166,7 @@ index 62d7880..ee40e39 100644
- op->req->fAnyOperationsAborted = TRUE;
+ args[0] = (DWORD_PTR)szDir;
+ FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ szText, 0, 0, szBuffer, sizeof(szBuffer), (__ms_va_list*)args);
+ szText, 0, 0, szBuffer, sizeof(szBuffer)/sizeof(szBuffer[0]), (__ms_va_list*)args);
+ hIcon = LoadIconW(ids.hIconInstance, (LPWSTR)MAKEINTRESOURCE(ids.icon_resource_id));
+
+ ret = SHELL_ConfirmMsgBox(hWnd, szBuffer, szCaption, hIcon, op && op->bManyItems);

View File

@ -446,7 +446,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
@@ -4949,7 +4994,11 @@
@@ -4947,7 +4992,11 @@
}
else
{
@ -458,7 +458,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
UINT height;
UINT width;
@@ -5013,7 +5062,11 @@
@@ -5011,7 +5060,11 @@
void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -2892,7 +2892,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
const void *idx_data, UINT start_idx, INT base_vertex_index, UINT start_instance, UINT instance_count)
{
if (idx_size)
@@ -92,7 +96,11 @@
@@ -85,7 +89,11 @@
*/
/* Context activation is done by the caller. */
@ -2904,7 +2904,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType,
const void *idxData, UINT idxSize, UINT startIdx)
{
@@ -100,6 +108,9 @@
@@ -93,6 +101,9 @@
const WORD *pIdxBufS = NULL;
const DWORD *pIdxBufL = NULL;
UINT vx_index;
@ -2914,7 +2914,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
LONG SkipnStrides = startIdx;
BOOL pixelShader = use_ps(state);
BOOL specular_fog = FALSE;
@@ -449,7 +460,11 @@
@@ -442,7 +453,11 @@
}
/* Context activation is done by the caller. */
@ -2926,7 +2926,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType,
const void *idxData, UINT idxSize, UINT startIdx)
{
@@ -506,7 +521,11 @@
@@ -499,7 +514,11 @@
}
/* Context activation is done by the caller. */
@ -2938,7 +2938,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType,
const void *idxData, UINT idxSize, UINT startIdx, UINT base_vertex_index, UINT instance_count)
{
@@ -591,10 +610,17 @@
@@ -584,10 +603,17 @@
}
/* Routine common to the draw primitive and draw indexed primitive routines */
@ -2956,7 +2956,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
const struct wined3d_stream_info *stream_info;
struct wined3d_event_query *ib_query = NULL;
struct wined3d_stream_info si_emulated;
@@ -607,6 +633,7 @@
@@ -600,6 +626,7 @@
if (!index_count) return;
@ -2964,7 +2964,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
context = context_acquire(device, wined3d_rendertarget_view_get_surface(state->fb.render_targets[0]));
if (!context->valid)
{
@@ -648,6 +675,49 @@
@@ -641,6 +668,49 @@
wined3d_cs_switch_onscreen_ds(device->cs, context, ds);
if (ds->resource.locations & location)
@ -3014,7 +3014,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
SetRect(&current_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy);
else
SetRectEmpty(&current_rect);
@@ -660,6 +730,7 @@
@@ -653,6 +723,7 @@
}
}
@ -3022,7 +3022,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
if (!context_apply_draw_state(context, device, state))
{
context_release(context);
@@ -670,6 +741,18 @@
@@ -663,6 +734,18 @@
if (state->fb.depth_stencil && state->render_states[WINED3D_RS_ZWRITEENABLE])
{
struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil);
@ -3041,7 +3041,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
DWORD location = context->render_offscreen ? ds->container->resource.draw_binding : WINED3D_LOCATION_DRAWABLE;
surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy);
@@ -752,6 +835,7 @@
@@ -745,6 +828,7 @@
else
WARN_(d3d_perf)("Using immediate mode with vertex shaders for half float emulation.\n");
@ -3049,7 +3049,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
draw_strided_slow_vs(context, state, stream_info, index_count,
state->gl_primitive_type, idx_data, idx_size, start_idx);
}
@@ -770,6 +854,26 @@
@@ -763,6 +847,26 @@
else
{
draw_strided_fast(gl_info, state->gl_primitive_type, index_count, idx_size, idx_data,
@ -7437,7 +7437,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Read the framebuffer contents into a texture. Note that this function
@@ -2907,6 +3585,85 @@
@@ -2909,6 +3587,85 @@
}
}
@ -7523,7 +7523,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
/* Does a direct frame buffer -> texture copy. Stretching is done with single
* pixel copy calls. */
static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface,
@@ -3013,8 +3770,13 @@
@@ -3015,8 +3772,13 @@
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
@ -7537,7 +7537,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Uses the hardware to stretch and flip the image */
@@ -3082,7 +3844,11 @@
@@ -3084,7 +3846,11 @@
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@ -7549,7 +7549,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3279,6 +4045,7 @@
@@ -3281,6 +4047,7 @@
checkGLcall("glDeleteTextures(1, &backup)");
}
@ -7557,7 +7557,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (wined3d_settings.cs_multithreaded)
gl_info->gl_ops.gl.p_glFinish();
else if (wined3d_settings.strict_draw_ordering)
@@ -3290,6 +4057,17 @@
@@ -3292,6 +4059,17 @@
* and has a drawable, this path is never entered. */
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
@ -7575,7 +7575,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Front buffer coordinates are always full screen coordinates, but our GL
@@ -3320,6 +4098,7 @@
@@ -3322,6 +4100,7 @@
rect->bottom = drawable_height - rect->bottom;
}
@ -7583,7 +7583,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
/* Context activation is done by the caller. */
static void surface_blt_to_drawable(const struct wined3d_device *device,
struct wined3d_context *old_ctx,
@@ -3354,6 +4133,26 @@
@@ -3356,6 +4135,26 @@
/* Make sure the surface is up-to-date. This should probably use
* wined3d_resource_load_location() and worry about the destination
* surface too, unless we're overwriting it completely. */
@ -7610,7 +7610,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
wined3d_texture_load(src_surface->container, context, FALSE);
/* Activate the destination context, set it up for blitting */
@@ -3396,6 +4195,7 @@
@@ -3398,6 +4197,7 @@
/* Leave the opengl state valid for blitting */
device->blitter->unset_shader(context->gl_info);
@ -7618,7 +7618,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (wined3d_settings.cs_multithreaded)
gl_info->gl_ops.gl.p_glFinish();
else if (wined3d_settings.strict_draw_ordering
@@ -3409,6 +4209,14 @@
@@ -3411,6 +4211,14 @@
context = context_acquire(device, restore_rt);
context_release(context);
}
@ -7633,7 +7633,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color)
@@ -3432,9 +4240,15 @@
@@ -3434,9 +4242,15 @@
enum wined3d_texture_filter_type filter)
{
struct wined3d_device *device = dst_surface->resource.device;
@ -7649,7 +7649,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n",
dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect),
@@ -3559,7 +4373,9 @@
@@ -3561,7 +4375,9 @@
/* Blit from offscreen surface to render target */
struct wined3d_color_key old_blt_key = src_surface->container->src_blt_color_key;
DWORD old_color_key_flags = src_surface->container->color_key_flags;
@ -7659,7 +7659,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface);
@@ -3593,6 +4409,7 @@
@@ -3595,6 +4411,7 @@
wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, NULL);
}
@ -7667,7 +7667,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
context = context_acquire(device, dst_surface);
surface_blt_to_drawable(device, context, filter,
flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_ALPHATEST),
@@ -3605,6 +4422,18 @@
@@ -3607,6 +4424,18 @@
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
@ -7686,7 +7686,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return WINED3D_OK;
}
@@ -3679,6 +4508,7 @@
@@ -3681,6 +4510,7 @@
{
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
@ -7694,7 +7694,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB))
|| (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
&& (location & WINED3D_LOCATION_TEXTURE_RGB)))
@@ -3687,6 +4517,15 @@
@@ -3689,6 +4519,15 @@
surface->ds_current_size.cx = w;
surface->ds_current_size.cy = h;
surface->resource.locations = location;
@ -7710,7 +7710,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Context activation is done by the caller. */
@@ -3701,7 +4540,11 @@
@@ -3703,7 +4542,11 @@
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
@ -7722,7 +7722,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
w = surface->ds_current_size.cx;
h = surface->ds_current_size.cy;
@@ -3727,7 +4570,11 @@
@@ -3729,7 +4572,11 @@
return;
}
@ -7734,7 +7734,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
TRACE("Surface was discarded, no need copy data.\n");
switch (location)
@@ -3744,6 +4591,7 @@
@@ -3746,6 +4593,7 @@
default:
FIXME("Unhandled location %#x\n", location);
}
@ -7742,7 +7742,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED;
surface->resource.locations |= location;
surface->ds_current_size.cx = surface->resource.width;
@@ -3755,6 +4603,19 @@
@@ -3757,6 +4605,19 @@
{
FIXME("No up to date depth stencil location.\n");
surface->resource.locations |= location;
@ -7762,7 +7762,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
@@ -3819,9 +4680,13 @@
@@ -3821,9 +4682,13 @@
context_invalidate_state(context, STATE_FRAMEBUFFER);
@ -7776,7 +7776,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
}
else if (location == WINED3D_LOCATION_DRAWABLE)
@@ -3837,9 +4702,13 @@
@@ -3839,9 +4704,13 @@
context_invalidate_state(context, STATE_FRAMEBUFFER);
@ -7790,7 +7790,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
}
else
@@ -3847,6 +4716,7 @@
@@ -3849,6 +4718,7 @@
ERR("Invalid location (%#x) specified.\n", location);
}
@ -7798,7 +7798,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
surface->resource.locations |= location;
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
@@ -3892,6 +4762,135 @@
@@ -3894,6 +4764,135 @@
TRACE("Surface was discarded, nothing to do.\n");
return WINED3D_OK;
}
@ -7934,7 +7934,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& wined3d_resource_is_offscreen(&surface->container->resource))
@@ -3901,6 +4900,7 @@
@@ -3903,6 +4902,7 @@
}
surface_get_rect(surface, NULL, &r);
@ -7942,7 +7942,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
surface_blt_to_drawable(surface->resource.device, context,
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
@@ -3969,6 +4969,66 @@
@@ -3971,6 +4971,66 @@
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location,
@ -8009,7 +8009,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
&rect, surface, dst_location, &rect);
return WINED3D_OK;
@@ -3978,6 +5038,7 @@
@@ -3980,6 +5040,7 @@
if (srgb)
{
@ -8017,7 +8017,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding))
== WINED3D_LOCATION_TEXTURE_RGB)
{
@@ -4006,6 +5067,39 @@
@@ -4008,6 +5069,39 @@
wined3d_resource_prepare_system_memory(&surface->resource);
wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM);
}
@ -8057,7 +8057,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
wined3d_texture_prepare_texture(texture, context, srgb);
wined3d_texture_bind_and_dirtify(texture, context, srgb);
@@ -4020,7 +5114,11 @@
@@ -4022,7 +5116,11 @@
/* Don't use PBOs for converted surfaces. During PBO conversion we look at
* WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is
* getting called. */
@ -8069,7 +8069,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
TRACE("Removing the pbo attached to surface %p.\n", surface);
@@ -4029,6 +5127,7 @@
@@ -4031,6 +5129,7 @@
else
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
@ -8077,7 +8077,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
wined3d_resource_prepare_map_memory(&surface->resource, context);
wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
wined3d_resource_free_bo(&surface->resource);
@@ -4036,6 +5135,14 @@
@@ -4038,6 +5137,14 @@
}
wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data);
@ -8092,7 +8092,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (format.convert)
{
/* This code is entered for texture formats which need a fixup. */
@@ -4081,6 +5188,7 @@
@@ -4083,6 +5190,7 @@
wined3d_surface_upload_data(surface, gl_info, &format, &src_rect,
src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
@ -8100,7 +8100,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
HeapFree(GetProcessHeap(), 0, mem);
return WINED3D_OK;
@@ -4104,6 +5212,31 @@
@@ -4106,6 +5214,31 @@
struct wined3d_context *context, DWORD location)
{
struct wined3d_surface *surface = surface_from_resource(resource);
@ -8132,7 +8132,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
HRESULT hr;
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4111,6 +5244,7 @@
@@ -4113,6 +5246,7 @@
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
@ -8140,7 +8140,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
&& surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
{
surface_load_ds_location(surface, context, location);
@@ -4130,11 +5264,53 @@
@@ -4132,11 +5266,53 @@
}
}
@ -8196,7 +8196,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
switch (location)
@@ -4143,6 +5319,7 @@
@@ -4145,6 +5321,7 @@
case WINED3D_LOCATION_USER_MEMORY:
case WINED3D_LOCATION_SYSMEM:
case WINED3D_LOCATION_BUFFER:
@ -8204,7 +8204,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
surface_load_sysmem(surface, context, location);
break;
@@ -4160,6 +5337,24 @@
@@ -4162,6 +5339,24 @@
if (FAILED(hr = surface_load_texture(surface, context,
location == WINED3D_LOCATION_TEXTURE_SRGB)))
return;
@ -8229,7 +8229,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
break;
default:
@@ -4167,12 +5362,21 @@
@@ -4169,12 +5364,21 @@
break;
}
@ -8251,7 +8251,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }
@@ -4266,6 +5470,7 @@
@@ -4268,6 +5472,7 @@
const RECT *dst_rect, const struct wined3d_color *color)
{
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
@ -8259,7 +8259,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
struct wined3d_rendertarget_view view, *view_ptr = &view;
struct wined3d_fb_state fb = {&view_ptr, NULL, 1};
struct wined3d_texture *texture = dst_surface->container;
@@ -4286,6 +5491,21 @@
@@ -4288,6 +5493,21 @@
view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level;
device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
@ -8281,7 +8281,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return WINED3D_OK;
}
@@ -4294,6 +5514,7 @@
@@ -4296,6 +5516,7 @@
const RECT *dst_rect, float depth)
{
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
@ -8289,7 +8289,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
struct wined3d_rendertarget_view view;
struct wined3d_fb_state fb = {NULL, &view};
struct wined3d_texture *texture = dst_surface->container;
@@ -4309,6 +5530,20 @@
@@ -4311,6 +5532,20 @@
view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level;
device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0);
@ -8310,7 +8310,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return WINED3D_OK;
}
@@ -4466,6 +5701,7 @@
@@ -4468,6 +5703,7 @@
int bpp, srcheight, srcwidth, dstheight, dstwidth, width;
const struct wined3d_format *src_format, *dst_format;
struct wined3d_texture *src_texture = NULL;
@ -8318,7 +8318,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
void *src_data = NULL, *dst_data = NULL;
UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
const BYTE *sbase = NULL;
@@ -4496,6 +5732,23 @@
@@ -4498,6 +5734,23 @@
wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
src_data = dst_data;
src_row_pitch = dst_row_pitch;
@ -8342,7 +8342,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format = dst_surface->resource.format;
dst_format = src_format;
}
@@ -4504,12 +5757,14 @@
@@ -4506,12 +5759,14 @@
dst_format = dst_surface->resource.format;
if (src_surface)
{
@ -8357,7 +8357,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (dst_surface->resource.format->id != src_surface->resource.format->id)
{
if (!(src_texture = surface_convert_format(src_surface, dst_format->id)))
@@ -4520,9 +5775,13 @@
@@ -4522,9 +5777,13 @@
}
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0));
}
@ -8371,7 +8371,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format = src_surface->resource.format;
}
else
@@ -4530,8 +5789,12 @@
@@ -4532,8 +5791,12 @@
src_format = dst_format;
}
@ -8384,7 +8384,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
bpp = dst_surface->resource.format->byte_count;
@@ -4542,12 +5805,24 @@
@@ -4544,12 +5807,24 @@
width = (dst_rect->right - dst_rect->left) * bpp;
if (src_surface)
@ -8409,7 +8409,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS)
{
@@ -4582,7 +5857,11 @@
@@ -4584,7 +5859,11 @@
}
hr = surface_cpu_blt_compressed(sbase, dbuf,
@ -8421,7 +8421,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format, flags, fx);
goto release;
}
@@ -4590,7 +5869,11 @@
@@ -4592,7 +5871,11 @@
/* First, all the 'source-less' blits */
if (flags & WINEDDBLT_COLORFILL)
{
@ -8433,7 +8433,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
flags &= ~WINEDDBLT_COLORFILL;
}
@@ -4604,12 +5887,21 @@
@@ -4606,12 +5889,21 @@
switch (fx->dwROP)
{
case BLACKNESS:
@ -8455,7 +8455,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
break;
case SRCCOPY: /* Well, we do that below? */
break;
@@ -4660,6 +5952,7 @@
@@ -4662,6 +5954,7 @@
for (y = 0; y < dstheight; ++y)
{
memcpy(dbuf, sbuf, width);
@ -8463,7 +8463,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
sbuf += src_row_pitch;
dbuf += dst_row_pitch;
}
@@ -4673,6 +5966,21 @@
@@ -4675,6 +5968,21 @@
{
sbuf -= src_row_pitch;
dbuf -= dst_row_pitch;
@ -8485,7 +8485,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
memcpy(dbuf, sbuf, width);
}
}
@@ -4682,8 +5990,13 @@
@@ -4684,8 +5992,13 @@
for (y = 0; y < dstheight; ++y)
{
memmove(dbuf, sbuf, width);
@ -8499,7 +8499,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -4692,9 +6005,15 @@
@@ -4694,9 +6007,15 @@
/* Stretching in y direction only. */
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8515,7 +8515,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -4704,6 +6023,7 @@
@@ -4706,6 +6025,7 @@
int last_sy = -1;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8523,7 +8523,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
sbuf = sbase + (sy >> 16) * src_row_pitch;
if ((sy >> 16) == (last_sy >> 16))
@@ -4711,6 +6031,15 @@
@@ -4713,6 +6033,15 @@
/* This source row is the same as last source row -
* Copy the already stretched row. */
memcpy(dbuf, dbuf - dst_row_pitch, width);
@ -8539,7 +8539,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
else
{
@@ -4757,6 +6086,7 @@
@@ -4759,6 +6088,7 @@
}
#undef STRETCH_ROW
}
@ -8547,7 +8547,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dbuf += dst_row_pitch;
last_sy = sy;
}
@@ -4765,6 +6095,16 @@
@@ -4767,6 +6097,16 @@
else
{
LONG dstyinc = dst_row_pitch, dstxinc = bpp;
@ -8564,7 +8564,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff;
DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff;
if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE))
@@ -4814,7 +6154,11 @@
@@ -4816,7 +6156,11 @@
LONG tmpxy;
dTopLeft = dbuf;
dTopRight = dbuf + ((dstwidth - 1) * bpp);
@ -8576,7 +8576,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp);
if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY)
@@ -4891,6 +6235,7 @@
@@ -4893,6 +6237,7 @@
flags &= ~(WINEDDBLT_DDFX);
}
@ -8584,7 +8584,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
#define COPY_COLORKEY_FX(type) \
do { \
const type *s; \
@@ -4912,6 +6257,29 @@
@@ -4914,6 +6259,29 @@
d = (type *)(((BYTE *)d) + dstyinc); \
} \
} while(0)
@ -8614,7 +8614,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
switch (bpp)
{
@@ -4930,7 +6298,11 @@
@@ -4932,7 +6300,11 @@
BYTE *d = dbuf, *dx;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8626,7 +8626,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dx = d;
for (x = sx = 0; x < dstwidth; ++x, sx+= xinc)
{
@@ -4961,10 +6333,12 @@
@@ -4963,10 +6335,12 @@
}
}
@ -8639,7 +8639,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
error:
if (flags && FIXME_ON(d3d_surface))
{
@@ -4972,6 +6346,7 @@
@@ -4974,6 +6348,7 @@
}
release:
@ -8647,7 +8647,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (dst_data)
{
wined3d_resource_release_map_ptr(&dst_surface->resource, context);
@@ -4990,6 +6365,14 @@
@@ -4992,6 +6367,14 @@
wined3d_texture_decref(src_texture);
if (context)
context_release(context);
@ -8662,7 +8662,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return hr;
}
@@ -5024,6 +6407,7 @@
@@ -5026,6 +6409,7 @@
cpu_blit_depth_fill,
};
@ -8670,7 +8670,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect,
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter)
@@ -5031,6 +6415,16 @@
@@ -5033,6 +6417,16 @@
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
struct wined3d_device *device = dst_surface->resource.device;
DWORD src_ds_flags, dst_ds_flags;
@ -8687,7 +8687,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
BOOL scale, convert;
static const DWORD simple_blit = WINEDDBLT_ASYNC
@@ -5039,6 +6433,106 @@
@@ -5041,6 +6435,106 @@
| WINEDDBLT_DEPTHFILL
| WINEDDBLT_DONOTWAIT;
@ -8794,7 +8794,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (!device->d3d_initialized)
{
WARN("D3D not initialized, using fallback.\n");
@@ -5081,8 +6575,13 @@
@@ -5083,8 +6577,13 @@
}
scale = src_surface
@ -8808,7 +8808,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id;
dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
@@ -5100,6 +6599,7 @@
@@ -5102,6 +6601,7 @@
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth))
@ -8816,7 +8816,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return;
if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth)))
@@ -5118,6 +6618,32 @@
@@ -5120,6 +6620,32 @@
* implement those in the CPU blitter at the moment. */
if ((dst_surface->resource.locations & dst_surface->resource.map_binding)
&& (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding)))
@ -8849,7 +8849,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5136,6 +6662,7 @@
@@ -5138,6 +6664,7 @@
if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color))
goto fallback;
@ -8857,7 +8857,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color)))
return;
}
@@ -5146,6 +6673,18 @@
@@ -5148,6 +6675,18 @@
/* Upload */
if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM)
&& !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM))
@ -8876,7 +8876,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
if (scale)
TRACE("Not doing upload because of scaling.\n");
@@ -5153,6 +6692,7 @@
@@ -5155,6 +6694,7 @@
TRACE("Not doing upload because of format conversion.\n");
else
{
@ -8884,7 +8884,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
POINT dst_point = {dst_rect->left, dst_rect->top};
if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect)))
@@ -5165,6 +6705,15 @@
@@ -5167,6 +6707,15 @@
context_release(context);
}
return;
@ -8900,7 +8900,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -5189,6 +6738,7 @@
@@ -5191,6 +6740,7 @@
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@ -8908,7 +8908,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return;
}
@@ -5385,6 +6935,50 @@
@@ -5387,6 +6937,50 @@
wined3d_surface_location_invalidated,
wined3d_surface_load_location,
};
@ -8959,7 +8959,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container,
const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags)
@@ -5452,7 +7046,11 @@
@@ -5454,7 +7048,11 @@
}
surface->container = container;
@ -8971,7 +8971,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
list_init(&surface->renderbuffers);
list_init(&surface->overlays);
@@ -5484,9 +7082,14 @@
@@ -5486,9 +7084,14 @@
if (surface->resource.map_binding == WINED3D_LOCATION_DIB)
{
wined3d_resource_free_sysmem(&surface->resource);
@ -8986,7 +8986,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
return hr;
@@ -5513,7 +7116,11 @@
@@ -5515,7 +7118,11 @@
if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags)))
{
WARN("Failed to initialize surface, returning %#x.\n", hr);