Rebase against e28d6b2fb099795d2472a97d7ab0bfe868e90421.

This commit is contained in:
Sebastian Lackner 2015-09-08 19:33:15 +02:00
parent 08738c151c
commit 2517360ebd
18 changed files with 270 additions and 950 deletions

View File

@ -62,7 +62,7 @@ for more details.*
* Add stub for D3DXComputeNormalMap
* Add stub for D3DXFrameFind ([Wine Bug #38334](https://bugs.winehq.org/show_bug.cgi?id=38334))
* Add stub for NtSetLdtEntries/ZwSetLdtEntries ([Wine Bug #26268](https://bugs.winehq.org/show_bug.cgi?id=26268))
* Add stub for dwmapi.DwmUpdateThumbnailProperties
* ~~Add stub for dwmapi.DwmUpdateThumbnailProperties~~
* Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163))
* Add stub for ntoskrnl.ExAcquireResourceExclusiveLite
* Add stub for ntoskrnl.ExDeleteResourceLite
@ -167,7 +167,7 @@ for more details.*
* Fix wrong version of ID3DXEffect interface for d3dx9_24
* Fix wrong version of ID3DXEffect interface for d3dx9_25 ([Wine Bug #25138](https://bugs.winehq.org/show_bug.cgi?id=25138))
* Forward exitcode from child process when in wineconsole
* Free RPC parameters allocated by application before anything else ([Wine Bug #36743](https://bugs.winehq.org/show_bug.cgi?id=36743))
* ~~Free RPC parameters allocated by application before anything else~~ ([Wine Bug #36743](https://bugs.winehq.org/show_bug.cgi?id=36743))
* GetMessage should remove already seen messages with higher priority ([Wine Bug #28884](https://bugs.winehq.org/show_bug.cgi?id=28884))
* GetMonitorInfo returns the same name for all monitors ([Wine Bug #37709](https://bugs.winehq.org/show_bug.cgi?id=37709))
* GetSecurityInfo returns NULL DACL for process object ([Wine Bug #15980](https://bugs.winehq.org/show_bug.cgi?id=15980))
@ -291,7 +291,7 @@ for more details.*
* Support for stored file ACLs ([Wine Bug #33576](https://bugs.winehq.org/show_bug.cgi?id=33576))
* Support for ws2_32.dll.WSAPoll ([Wine Bug #38601](https://bugs.winehq.org/show_bug.cgi?id=38601))
* Translate flags in LaunchINFSectionW
* Try harder to get the host name address in getaddrinfo() ([Wine Bug #29609](https://bugs.winehq.org/show_bug.cgi?id=29609))
* ~~Try harder to get the host name address in getaddrinfo()~~ ([Wine Bug #29609](https://bugs.winehq.org/show_bug.cgi?id=29609))
* Tumblebugs 2 requires DXTn software encoding support ([Wine Bug #29586](https://bugs.winehq.org/show_bug.cgi?id=29586))
* Update a XIM candidate position when cursor location changes ([Wine Bug #30938](https://bugs.winehq.org/show_bug.cgi?id=30938))
* Use GLX_MESA_query_renderer extension to get more exact GPU infos

9
debian/changelog vendored
View File

@ -1,5 +1,12 @@
wine-staging (1.7.52) UNRELEASED; urgency=low
* Removed patch to fix possible memory leak in netprofm init_networks.
* Removed patch to fix possible memory leak in netprofm init_networks (fixed
upstream).
* Removed patch for stub of dwmapi.DwmUpdateThumbnailProperties (accepted
upstream).
* Removed patch free RPC parameters allocated by application before anything
else (fixed upstream).
* Removed patch to try harder to get the host name address in getaddrinfo
(accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 07 Sep 2015 16:51:25 +0200
wine-staging (1.7.51) unstable; urgency=low

View File

@ -1,70 +0,0 @@
From 8487e09eae89a4926de9327d7cc7c10049064229 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 2 Sep 2015 13:19:27 +1000
Subject: dwmapi: Add DwmUpdateThumbnailProperties stub
---
dlls/dwmapi/dwmapi.spec | 2 +-
dlls/dwmapi/dwmapi_main.c | 9 +++++++++
include/dwmapi.h | 11 +++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/dlls/dwmapi/dwmapi.spec b/dlls/dwmapi/dwmapi.spec
index e83ee22..0985b40 100644
--- a/dlls/dwmapi/dwmapi.spec
+++ b/dlls/dwmapi/dwmapi.spec
@@ -42,4 +42,4 @@
@ stub DwmSetPresentParameters
@ stdcall DwmSetWindowAttribute(long long ptr long)
@ stdcall DwmUnregisterThumbnail(long)
-@ stub DwmUpdateThumbnailProperties
+@ stdcall DwmUpdateThumbnailProperties(long ptr)
diff --git a/dlls/dwmapi/dwmapi_main.c b/dlls/dwmapi/dwmapi_main.c
index 08373b9..a776cfe 100644
--- a/dlls/dwmapi/dwmapi_main.c
+++ b/dlls/dwmapi/dwmapi_main.c
@@ -250,3 +250,12 @@ HRESULT WINAPI DwmDetachMilContent(HWND hwnd)
FIXME("(%p) stub\n", hwnd);
return E_NOTIMPL;
}
+
+/**********************************************************************
+ * DwmUpdateThumbnailProperties (DWMAPI.@)
+ */
+HRESULT WINAPI DwmUpdateThumbnailProperties(HTHUMBNAIL thumbnail, const DWM_THUMBNAIL_PROPERTIES *props)
+{
+ FIXME("(%p, %p) stub\n", thumbnail, props);
+ return E_NOTIMPL;
+}
diff --git a/include/dwmapi.h b/include/dwmapi.h
index 3c5ed8f..035c831 100644
--- a/include/dwmapi.h
+++ b/include/dwmapi.h
@@ -107,6 +107,16 @@ typedef struct _DWM_BLURBEHIND
BOOL fTransitionOnMaximized;
} DWM_BLURBEHIND, *PDWM_BLURBEHIND;
+typedef struct _DWM_THUMBNAIL_PROPERTIES
+{
+ DWORD dwFlags;
+ RECT rcDestination;
+ RECT rcSource;
+ BYTE opacity;
+ BOOL fVisible;
+ BOOL fSourceClientAreaOnly;
+} DWM_THUMBNAIL_PROPERTIES, *PDWM_THUMBNAIL_PROPERTIES;
+
#include <poppack.h>
DWMAPI DwmDefWindowProc(HWND, UINT, WPARAM, LPARAM, LRESULT*);
@@ -121,6 +131,7 @@ DWMAPI DwmIsCompositionEnabled(BOOL*);
DWMAPI DwmRegisterThumbnail(HWND, HWND, PHTHUMBNAIL);
DWMAPI DwmSetWindowAttribute(HWND, DWORD, LPCVOID, DWORD);
DWMAPI DwmUnregisterThumbnail(HTHUMBNAIL);
+DWMAPI DwmUpdateThumbnailProperties(HTHUMBNAIL, const DWM_THUMBNAIL_PROPERTIES *);
#ifdef __cplusplus
}
--
2.5.1

View File

@ -1 +0,0 @@
Fixes: Add stub for dwmapi.DwmUpdateThumbnailProperties

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "07cc9a34a87cd08c87ae198e4aeb8c9bb7f55175"
echo "e28d6b2fb099795d2472a97d7ab0bfe868e90421"
}
# Show version information
@ -128,7 +128,6 @@ patch_enable_all ()
enable_dinput_Events="$1"
enable_dsound_EAX="$1"
enable_dsound_Fast_Mixer="$1"
enable_dwmapi_DwmUpdateThumbnailProperties="$1"
enable_dxdiagn_Enumerate_DirectSound="$1"
enable_dxdiagn_GetChildContainer_Leaf_Nodes="$1"
enable_dxgi_GetDesc="$1"
@ -222,7 +221,6 @@ patch_enable_all ()
enable_regedit_Reg_Parser="$1"
enable_riched20_IText_Interface="$1"
enable_rpcrt4_Pipe_Transport="$1"
enable_rpcrt4_Use_After_Free="$1"
enable_secur32_ANSI_NTLM_Credentials="$1"
enable_server_Address_List_Change="$1"
enable_server_ClipCursor="$1"
@ -325,7 +323,6 @@ patch_enable_all ()
enable_ws2_32_WSACleanup="$1"
enable_ws2_32_WSAPoll="$1"
enable_ws2_32_WriteWatches="$1"
enable_ws2_32_getaddrinfo="$1"
enable_wtsapi32_EnumerateProcesses="$1"
}
@ -480,9 +477,6 @@ patch_enable ()
dsound-Fast_Mixer)
enable_dsound_Fast_Mixer="$2"
;;
dwmapi-DwmUpdateThumbnailProperties)
enable_dwmapi_DwmUpdateThumbnailProperties="$2"
;;
dxdiagn-Enumerate_DirectSound)
enable_dxdiagn_Enumerate_DirectSound="$2"
;;
@ -762,9 +756,6 @@ patch_enable ()
rpcrt4-Pipe_Transport)
enable_rpcrt4_Pipe_Transport="$2"
;;
rpcrt4-Use_After_Free)
enable_rpcrt4_Use_After_Free="$2"
;;
secur32-ANSI_NTLM_Credentials)
enable_secur32_ANSI_NTLM_Credentials="$2"
;;
@ -1071,9 +1062,6 @@ patch_enable ()
ws2_32-WriteWatches)
enable_ws2_32_WriteWatches="$2"
;;
ws2_32-getaddrinfo)
enable_ws2_32_getaddrinfo="$2"
;;
wtsapi32-EnumerateProcesses)
enable_wtsapi32_EnumerateProcesses="$2"
;;
@ -2919,18 +2907,6 @@ if test "$enable_dsound_EAX" -eq 1; then
) >> "$patchlist"
fi
# Patchset dwmapi-DwmUpdateThumbnailProperties
# |
# | Modified files:
# | * dlls/dwmapi/dwmapi.spec, dlls/dwmapi/dwmapi_main.c, include/dwmapi.h
# |
if test "$enable_dwmapi_DwmUpdateThumbnailProperties" -eq 1; then
patch_apply dwmapi-DwmUpdateThumbnailProperties/0001-dwmapi-Add-DwmUpdateThumbnailProperties-stub.patch
(
echo '+ { "Alistair Leslie-Hughes", "dwmapi: Add DwmUpdateThumbnailProperties stub.", 1 },';
) >> "$patchlist"
fi
# Patchset dxdiagn-Enumerate_DirectSound
# |
# | This patchset fixes the following Wine bugs:
@ -4553,21 +4529,6 @@ if test "$enable_riched20_IText_Interface" -eq 1; then
) >> "$patchlist"
fi
# Patchset rpcrt4-Use_After_Free
# |
# | This patchset fixes the following Wine bugs:
# | * [#36743] Free RPC parameters allocated by application before anything else
# |
# | Modified files:
# | * dlls/rpcrt4/ndr_stubless.c
# |
if test "$enable_rpcrt4_Use_After_Free" -eq 1; then
patch_apply rpcrt4-Use_After_Free/0001-rpcrt4-Free-parameters-allocated-by-application-befo.patch
(
echo '+ { "Jérôme Gardou", "rpcrt4: Free parameters allocated by application before anything else.", 1 },';
) >> "$patchlist"
fi
# Patchset secur32-ANSI_NTLM_Credentials
# |
# | This patchset fixes the following Wine bugs:
@ -6498,21 +6459,6 @@ if test "$enable_ws2_32_WSAPoll" -eq 1; then
) >> "$patchlist"
fi
# Patchset ws2_32-getaddrinfo
# |
# | This patchset fixes the following Wine bugs:
# | * [#29609] Try harder to get the host name address in getaddrinfo()
# |
# | Modified files:
# | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c
# |
if test "$enable_ws2_32_getaddrinfo" -eq 1; then
patch_apply ws2_32-getaddrinfo/0001-ws2_32-Try-harder-to-get-the-host-name-address-in-ge.patch
(
echo '+ { "Bruno Jesus", "ws2_32: Try harder to get the host name address in getaddrinfo().", 1 },';
) >> "$patchlist"
fi
# Patchset wtsapi32-EnumerateProcesses
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,53 +0,0 @@
From 9cfab0a867f609d922ebe3ee2690f1fa7fe96976 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= <jerome.gardou@reactos.org>
Date: Mon, 16 Jun 2014 15:55:01 +0200
Subject: rpcrt4: Free parameters allocated by application before anything
else.
The freer function calculates conformance and variance using values in
parameters which can be freed earlier in the loop, so it is necessary to
free those before anything else.
See http://bugs.winehq.org/show_bug.cgi?id=36743 for details.
---
dlls/rpcrt4/ndr_stubless.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c
index c9d9930..92bfd9b 100644
--- a/dlls/rpcrt4/ndr_stubless.c
+++ b/dlls/rpcrt4/ndr_stubless.c
@@ -1109,6 +1109,18 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
unsigned int i;
LONG_PTR *retval_ptr = NULL;
+ if (phase == STUBLESS_FREE)
+ {
+ for (i = 0; i < number_of_params; i++)
+ {
+ unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset;
+ if (params[i].attr.MustFree)
+ {
+ call_freer(pStubMsg, pArg, &params[i]);
+ }
+ }
+ }
+
for (i = 0; i < number_of_params; i++)
{
unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset;
@@ -1126,11 +1138,7 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
call_marshaller(pStubMsg, pArg, &params[i]);
break;
case STUBLESS_FREE:
- if (params[i].attr.MustFree)
- {
- call_freer(pStubMsg, pArg, &params[i]);
- }
- else if (params[i].attr.ServerAllocSize)
+ if (params[i].attr.ServerAllocSize)
{
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
}
--
2.4.0

View File

@ -1 +0,0 @@
Fixes: [36743] Free RPC parameters allocated by application before anything else

View File

@ -1,4 +1,4 @@
From 518ce36e50012eb7f2dea0e4daf34c73fae4456c Mon Sep 17 00:00:00 2001
From 3774380efa36ca757552bbb624cfe3904ba7a4fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 12:22:30 +0100
Subject: wined3d: Move surface locations into the resource.
@ -7,16 +7,15 @@ Subject: wined3d: Move surface locations into the resource.
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/device.c | 4 +-
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 99 ++++++++++++++++++++-------------------
dlls/wined3d/swapchain.c | 4 +-
dlls/wined3d/surface.c | 93 ++++++++++++++++++++-------------------
dlls/wined3d/wined3d_private.h | 1 -
6 files changed, 56 insertions(+), 56 deletions(-)
5 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 0bd7c22..f218979 100644
index 6a321db..fc91209 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7821,7 +7821,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -7849,7 +7849,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@ -26,7 +25,7 @@ index 0bd7c22..f218979 100644
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0521a94..b4bc3ac 100644
index 937fdb7..1ef681a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
@ -48,7 +47,7 @@ index 0521a94..b4bc3ac 100644
ds->ds_current_size.cx,
ds->ds_current_size.cy);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 913ada5..567550e 100644
index d2d3bce..afccecd 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -651,7 +651,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -61,7 +60,7 @@ index 913ada5..567550e 100644
else
SetRectEmpty(&current_rect);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 9abffb3..78f92d3 100644
index 4bc38d8..d1493a2 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
@ -109,7 +108,7 @@ index 9abffb3..78f92d3 100644
{
TRACE("surface is already in texture\n");
return;
@@ -2109,7 +2109,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2096,7 +2096,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
create_dib = TRUE;
}
@ -118,20 +117,7 @@ index 9abffb3..78f92d3 100644
wined3d_resource_free_sysmem(&surface->resource);
width = texture_resource->width;
@@ -3175,9 +3175,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
back->flags = front->flags;
front->flags = tmp_flags;
- tmp_flags = back->locations;
- back->locations = front->locations;
- front->locations = tmp_flags;
+ tmp_flags = back->resource.locations;
+ back->resource.locations = front->resource.locations;
+ front->resource.locations = tmp_flags;
}
}
@@ -3356,7 +3356,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3275,7 +3275,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@ -140,7 +126,7 @@ index 9abffb3..78f92d3 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3894,13 +3894,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
@@ -3813,13 +3813,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
{
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
@ -158,7 +144,7 @@ index 9abffb3..78f92d3 100644
}
/* Context activation is done by the caller. */
@@ -3915,7 +3916,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3834,7 +3835,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
@ -167,7 +153,7 @@ index 9abffb3..78f92d3 100644
{
w = surface->ds_current_size.cx;
h = surface->ds_current_size.cy;
@@ -3941,7 +3942,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3860,7 +3861,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return;
}
@ -176,7 +162,7 @@ index 9abffb3..78f92d3 100644
{
TRACE("Surface was discarded, no need copy data.\n");
switch (location)
@@ -3958,17 +3959,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3880,17 +3881,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
default:
FIXME("Unhandled location %#x\n", location);
}
@ -198,7 +184,7 @@ index 9abffb3..78f92d3 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
@@ -4057,7 +4058,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3979,7 +3980,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
ERR("Invalid location (%#x) specified.\n", location);
}
@ -207,7 +193,7 @@ index 9abffb3..78f92d3 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
}
@@ -4066,7 +4067,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
@@ -3988,7 +3989,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@ -216,7 +202,7 @@ index 9abffb3..78f92d3 100644
}
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
@@ -4075,9 +4076,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
@@ -3997,9 +3998,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
wined3d_texture_set_dirty(surface->container);
@ -228,7 +214,7 @@ index 9abffb3..78f92d3 100644
ERR("Surface %p does not have any up to date location.\n", surface);
}
@@ -4113,7 +4114,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -4035,7 +4036,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
UINT size = surface->resource.size;
surface_get_memory(surface, &dst, location);
@ -237,7 +223,7 @@ index 9abffb3..78f92d3 100644
if (dst.buffer_object)
{
@@ -4146,33 +4147,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4068,33 +4069,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -277,7 +263,7 @@ index 9abffb3..78f92d3 100644
}
/* Context activation is done by the caller. */
@@ -4212,14 +4213,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4134,14 +4135,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource)
@ -294,7 +280,7 @@ index 9abffb3..78f92d3 100644
&& (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
@@ -4235,13 +4236,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4157,13 +4158,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
@ -310,7 +296,7 @@ index 9abffb3..78f92d3 100644
WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE;
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@@ -4256,7 +4257,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4178,7 +4179,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (srgb)
{
@ -319,7 +305,7 @@ index 9abffb3..78f92d3 100644
== WINED3D_LOCATION_TEXTURE_RGB)
{
/* Performance warning... */
@@ -4267,7 +4268,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4189,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
else
{
@ -328,7 +314,7 @@ index 9abffb3..78f92d3 100644
== WINED3D_LOCATION_TEXTURE_SRGB)
{
/* Performance warning... */
@@ -4277,7 +4278,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4199,7 +4200,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
}
@ -337,7 +323,7 @@ index 9abffb3..78f92d3 100644
{
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
@@ -4312,7 +4313,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4234,7 +4235,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@ -346,7 +332,7 @@ index 9abffb3..78f92d3 100644
if (format.convert)
{
/* This code is entered for texture formats which need a fixup. */
@@ -4368,7 +4369,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4290,7 +4291,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
{
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@ -355,7 +341,7 @@ index 9abffb3..78f92d3 100644
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
@@ -4386,12 +4387,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4308,12 +4309,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
@ -370,7 +356,7 @@ index 9abffb3..78f92d3 100644
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
{
/* Already up to date, nothing to do. */
@@ -4400,12 +4401,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4322,12 +4323,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
else
{
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
@ -385,7 +371,7 @@ index 9abffb3..78f92d3 100644
{
TRACE("Location already up to date.\n");
return;
@@ -4419,7 +4420,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4341,7 +4342,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
required_access, surface->resource.access_flags);
}
@ -394,7 +380,7 @@ index 9abffb3..78f92d3 100644
{
ERR("Surface %p does not have any up to date location.\n", surface);
surface->flags |= SFLAG_LOST;
@@ -4458,7 +4459,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4380,7 +4381,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
surface_validate_location(surface, location);
@ -403,7 +389,7 @@ index 9abffb3..78f92d3 100644
surface_evict_sysmem(surface);
return;
@@ -5508,8 +5509,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5431,8 +5432,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
@ -414,7 +400,7 @@ index 9abffb3..78f92d3 100644
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5549,8 +5550,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5472,8 +5473,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
color_key = &src_surface->container->async.src_blt_color_key;
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY;
}
@ -425,26 +411,11 @@ index 9abffb3..78f92d3 100644
{
/* Upload */
if (scale)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 4f4d4df..e702d61 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -555,8 +555,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
- if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM)
- || (back_buffer->locations & WINED3D_LOCATION_SYSMEM)))
+ if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM)
+ || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM)))
{
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2828e47..bc6f994 100644
index 638b99d..2353881 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2348,7 +2348,6 @@ struct wined3d_surface
@@ -2378,7 +2378,6 @@ struct wined3d_surface
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
void *user_memory;
@ -453,5 +424,5 @@ index 2828e47..bc6f994 100644
DWORD flags;
--
2.4.2
2.5.1

View File

@ -1,4 +1,4 @@
From 013c83727f4fbbf15bbbe7ccb12d42d58d17e18d Mon Sep 17 00:00:00 2001
From e8ce3e8bef910f4908f92344d7c2d60abfa61935 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 4 Jan 2014 00:53:47 +0100
Subject: wined3d: Remove surface_validate_location.
@ -7,10 +7,10 @@ Subject: wined3d: Remove surface_validate_location.
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/device.c | 4 ++--
dlls/wined3d/surface.c | 29 +++++++++++------------------
dlls/wined3d/swapchain.c | 12 ++++++------
dlls/wined3d/swapchain.c | 4 ++--
dlls/wined3d/texture.c | 4 +---
dlls/wined3d/wined3d_private.h | 1 -
6 files changed, 21 insertions(+), 31 deletions(-)
6 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index fc91209..582746c 100644
@ -48,7 +48,7 @@ index 1ef681a..2683140 100644
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1dd4b69..4f646e4 100644
index d1493a2..dac754e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1170,7 +1170,7 @@ static void surface_unload(struct wined3d_resource *resource)
@ -87,7 +87,7 @@ index 1dd4b69..4f646e4 100644
}
else
{
@@ -3283,7 +3283,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
@@ -3206,7 +3206,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
@ -96,7 +96,7 @@ index 1dd4b69..4f646e4 100644
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
}
@@ -3556,7 +3556,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3479,7 +3479,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
@ -105,7 +105,7 @@ index 1dd4b69..4f646e4 100644
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
}
@@ -4062,13 +4062,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3985,13 +3985,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
@ -119,7 +119,7 @@ index 1dd4b69..4f646e4 100644
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4456,7 +4449,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4379,7 +4372,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
break;
}
@ -128,7 +128,7 @@ index 1dd4b69..4f646e4 100644
if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM))
surface_evict_sysmem(surface);
@@ -4630,7 +4623,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -4553,7 +4546,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT,
(old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL);
@ -137,7 +137,7 @@ index 1dd4b69..4f646e4 100644
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
}
@@ -5610,7 +5603,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5533,7 +5526,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
dst_surface, dst_surface->container->resource.draw_binding, &dst_rect);
context_release(context);
@ -146,7 +146,7 @@ index 1dd4b69..4f646e4 100644
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
@@ -5700,7 +5693,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
@@ -5623,7 +5616,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
}
surface->container = container;
@ -155,7 +155,7 @@ index 1dd4b69..4f646e4 100644
list_init(&surface->renderbuffers);
list_init(&surface->overlays);
@@ -5732,7 +5725,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
@@ -5655,7 +5648,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
if (surface->resource.map_binding == WINED3D_LOCATION_DIB)
{
wined3d_resource_free_sysmem(&surface->resource);
@ -165,43 +165,19 @@ index 1dd4b69..4f646e4 100644
}
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index cc7c3e0..b3c5b18 100644
index 27bcf70..bbe1b63 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -569,19 +569,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
/* Tell the front buffer surface that is has been modified. However,
* the other locations were preserved during that, so keep the flags.
* This serves to update the emulated overlay, if any. */
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
}
else
{
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
- surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
}
}
else
{
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
@@ -590,7 +590,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
*/
if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
{
- surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding);
+ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
}
}
@@ -858,7 +858,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
@@ -556,7 +556,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
@@ -829,7 +829,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
if (!(device->wined3d->flags & WINED3D_NO3D))
{
@ -226,7 +202,7 @@ index 187862c..7671f46 100644
static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 140588e..ef2dfa7 100644
index 2353881..e1f211f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2447,7 +2447,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,

View File

@ -1,4 +1,4 @@
From fe1d9b795638409df399927a874d91ee301b39e1 Mon Sep 17 00:00:00 2001
From d63992004de850506b8f90ce5b80f9f73bcaad92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 4 Jan 2014 01:02:15 +0100
Subject: wined3d: Remove surface_invalidate_location.
@ -9,16 +9,16 @@ Subject: wined3d: Remove surface_invalidate_location.
dlls/wined3d/device.c | 4 ++--
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 45 ++++++++++++++++-----------------------
dlls/wined3d/swapchain.c | 12 +++++------
dlls/wined3d/swapchain.c | 6 +++---
dlls/wined3d/texture.c | 6 ++----
dlls/wined3d/wined3d_private.h | 1 -
8 files changed, 31 insertions(+), 43 deletions(-)
8 files changed, 28 insertions(+), 40 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 8f74bf6..71c7c2e 100644
index 582746c..79333e3 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7865,7 +7865,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -7887,7 +7887,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
@ -28,7 +28,7 @@ index 8f74bf6..71c7c2e 100644
static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index b900417..4752fff 100644
index 31fafca..0986050 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3281,7 +3281,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
@ -41,7 +41,7 @@ index b900417..4752fff 100644
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a30c618..a127f9d 100644
index 8c995be..d2a08c4 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -393,7 +393,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@ -53,7 +53,7 @@ index a30c618..a127f9d 100644
}
}
@@ -4058,7 +4058,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4042,7 +4042,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
context_release(context);
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
@ -63,7 +63,7 @@ index a30c618..a127f9d 100644
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 4d47a21..8a27363 100644
index afccecd..d756182 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -629,7 +629,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -76,7 +76,7 @@ index 4d47a21..8a27363 100644
}
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 3dfa290..0a22b3d 100644
index bc31454..ad9310a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -599,7 +599,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
@ -163,7 +163,7 @@ index 3dfa290..0a22b3d 100644
if (context)
context_release(context);
}
@@ -3281,7 +3284,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
@@ -3213,7 +3216,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
@ -172,7 +172,7 @@ index 3dfa290..0a22b3d 100644
}
/* Uses the hardware to stretch and flip the image */
@@ -3349,7 +3352,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3281,7 +3284,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@ -181,7 +181,7 @@ index 3dfa290..0a22b3d 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3554,7 +3557,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3486,7 +3489,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
@ -190,7 +190,7 @@ index 3dfa290..0a22b3d 100644
}
/* Front buffer coordinates are always full screen coordinates, but our GL
@@ -4059,18 +4062,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3991,18 +3994,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
@ -209,7 +209,7 @@ index 3dfa290..0a22b3d 100644
static DWORD resource_access_from_location(DWORD location)
{
switch (location)
@@ -4620,7 +4611,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -4553,7 +4544,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
(old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
@ -218,7 +218,7 @@ index 3dfa290..0a22b3d 100644
}
const struct blit_shader ffp_blit = {
@@ -5600,7 +5591,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5533,7 +5524,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
@ -227,7 +227,7 @@ index 3dfa290..0a22b3d 100644
return WINED3D_OK;
}
@@ -5730,7 +5721,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
@@ -5655,7 +5646,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
{
wined3d_resource_free_sysmem(&surface->resource);
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB);
@ -237,7 +237,7 @@ index 3dfa290..0a22b3d 100644
return hr;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index cd1aabd..74aefd5 100644
index bbe1b63..4f6be9e 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -512,7 +512,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
@ -249,35 +249,16 @@ index cd1aabd..74aefd5 100644
swapchain->render_to_fbo = TRUE;
swapchain_update_draw_bindings(swapchain);
}
@@ -574,15 +574,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
else
{
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE);
}
}
else
{
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same. If it is FLIP however,
@@ -591,7 +591,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
{
wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
- surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding);
}
}
@@ -557,7 +557,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
@@ -866,7 +866,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same.
@@ -830,7 +830,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
if (!(device->wined3d->flags & WINED3D_NO3D))
{
wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE);
@ -287,10 +268,10 @@ index cd1aabd..74aefd5 100644
/* MSDN says we're only allowed a single fullscreen swapchain per device,
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index b596aef..3e4e65d 100644
index 0f06e55..f43929b 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -781,7 +781,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
@@ -775,7 +775,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
context = context_acquire(surface->resource.device, NULL);
surface_load_location(surface, context, surface->resource.map_binding);
context_release(context);
@ -299,7 +280,7 @@ index b596aef..3e4e65d 100644
}
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
@@ -793,9 +793,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
@@ -787,9 +787,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location)
{
@ -311,7 +292,7 @@ index b596aef..3e4e65d 100644
static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0612b17..e0bcbba 100644
index 2ada21f..9d2e40a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2429,7 +2429,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s,
@ -323,5 +304,5 @@ index 0612b17..e0bcbba 100644
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
--
2.5.0
2.5.1

View File

@ -1,17 +1,17 @@
From 2341723442d5ab7fb42bb82d066b306cc458813d Mon Sep 17 00:00:00 2001
From 00f61862ec59e32534adfabc359009143a9b9651 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 16 Jan 2014 22:04:55 +0100
Subject: wined3d: Move bitmap_data and user_memory into the resource.
I may want to change this to keep this in the surface. Not sure yet.
---
dlls/wined3d/surface.c | 32 ++++++++++++++++----------------
dlls/wined3d/surface.c | 26 +++++++++++++-------------
dlls/wined3d/swapchain.c | 6 +++---
dlls/wined3d/wined3d_private.h | 4 +---
3 files changed, 20 insertions(+), 22 deletions(-)
3 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ef52ed0..c689880 100644
index ad9310a..65eefa9 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -88,7 +88,7 @@ static void surface_cleanup(struct wined3d_surface *surface)
@ -75,7 +75,7 @@ index ef52ed0..c689880 100644
break;
case WINED3D_LOCATION_BUFFER:
@@ -2190,7 +2190,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2100,7 +2100,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
{
DeleteDC(surface->hDC);
DeleteObject(surface->dib.DIBsection);
@ -84,7 +84,7 @@ index ef52ed0..c689880 100644
surface->flags &= ~SFLAG_DIBSECTION;
create_dib = TRUE;
}
@@ -2222,7 +2222,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2132,7 +2132,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
else
surface->flags &= ~SFLAG_NONPOW2;
@ -93,7 +93,7 @@ index ef52ed0..c689880 100644
{
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
@@ -2680,11 +2680,11 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2750,11 +2750,11 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
break;
case WINED3D_LOCATION_USER_MEMORY:
@ -107,24 +107,11 @@ index ef52ed0..c689880 100644
break;
case WINED3D_LOCATION_BUFFER:
@@ -3052,9 +3052,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
{
void* tmp;
- tmp = front->dib.bitmap_data;
- front->dib.bitmap_data = back->dib.bitmap_data;
- back->dib.bitmap_data = tmp;
+ tmp = front->resource.bitmap_data;
+ front->resource.bitmap_data = back->resource.bitmap_data;
+ back->resource.bitmap_data = tmp;
tmp = front->resource.heap_memory;
front->resource.heap_memory = back->resource.heap_memory;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index e64715e..17f1afe 100644
index 4f6be9e..d0b8cf0 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -695,9 +695,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC
@@ -666,9 +666,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC
{
void *tmp;
@ -138,10 +125,10 @@ index e64715e..17f1afe 100644
if (front->resource.heap_memory)
ERR("GDI Surface %p has heap memory allocated.\n", front);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 640aa95..52280a7 100644
index 9d2e40a..3776439 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2080,7 +2080,7 @@ struct wined3d_resource
@@ -2164,7 +2164,7 @@ struct wined3d_resource
UINT depth;
UINT size;
DWORD priority;
@ -150,7 +137,7 @@ index 640aa95..52280a7 100644
UINT custom_row_pitch, custom_slice_pitch;
struct list resource_list_entry;
DWORD locations;
@@ -2263,7 +2263,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
@@ -2343,7 +2343,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
struct wined3d_surface_dib
{
HBITMAP DIBsection;
@ -158,7 +145,7 @@ index 640aa95..52280a7 100644
UINT bitmap_size;
};
@@ -2297,7 +2296,6 @@ struct wined3d_surface
@@ -2377,7 +2376,6 @@ struct wined3d_surface
struct wined3d_resource resource;
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
@ -167,5 +154,5 @@ index 640aa95..52280a7 100644
DWORD flags;
--
2.1.3
2.5.1

View File

@ -1,15 +1,15 @@
From b8a17a0ce26bee0843d1bab91a435575751b7063 Mon Sep 17 00:00:00 2001
From 2e105cc77b4f86b1dc044e3dc174a61df5d30a43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 13:25:48 +0100
Subject: wined3d: Remove surface->pbo.
---
dlls/wined3d/surface.c | 42 +++++++++++++++++++++---------------------
dlls/wined3d/surface.c | 36 ++++++++++++++++++------------------
dlls/wined3d/wined3d_private.h | 2 --
2 files changed, 21 insertions(+), 23 deletions(-)
2 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1496beb..e534a9f 100644
index 58d825c..4cdd104 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -46,7 +46,7 @@ static void surface_cleanup(struct wined3d_surface *surface)
@ -79,7 +79,7 @@ index 1496beb..e534a9f 100644
GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER));
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
checkGLcall("glUnmapBuffer");
@@ -1181,10 +1181,10 @@ HRESULT CDECL wined3d_surface_get_render_target_data(struct wined3d_surface *sur
@@ -1127,10 +1127,10 @@ HRESULT CDECL wined3d_surface_get_render_target_data(struct wined3d_surface *sur
/* Context activation is done by the caller. */
static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info)
{
@ -93,7 +93,7 @@ index 1496beb..e534a9f 100644
wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER);
}
@@ -1241,7 +1241,7 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1187,7 +1187,7 @@ static void surface_unload(struct wined3d_resource *resource)
}
/* Destroy PBOs, but load them into real sysmem before */
@ -102,7 +102,7 @@ index 1496beb..e534a9f 100644
surface_remove_pbo(surface, gl_info);
/* Destroy fbo render buffers. This is needed for implicit render targets, for
@@ -2837,7 +2837,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2753,7 +2753,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
context = context_acquire(device, NULL);
gl_info = context->gl_info;
@ -111,7 +111,7 @@ index 1496beb..e534a9f 100644
base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE));
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
checkGLcall("map PBO");
@@ -2928,7 +2928,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2844,7 +2844,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
}
if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY
|| surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM
@ -120,20 +120,7 @@ index 1496beb..e534a9f 100644
surface->resource.map_binding = WINED3D_LOCATION_DIB;
}
@@ -3209,9 +3209,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
/* Flip the PBO */
{
- GLuint tmp_pbo = front->pbo;
- front->pbo = back->pbo;
- back->pbo = tmp_pbo;
+ GLuint tmp_pbo = front->resource.buffer_object;
+ front->resource.buffer_object = back->resource.buffer_object;
+ back->resource.buffer_object = tmp_pbo;
}
/* Flip the opengl texture */
@@ -4388,7 +4388,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4180,7 +4180,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* 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. */
@ -143,10 +130,10 @@ index 1496beb..e534a9f 100644
TRACE("Removing the pbo attached to surface %p.\n", surface);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8cce2d9..7efecd4 100644
index f948f73..839dc7f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2324,8 +2324,6 @@ struct wined3d_surface
@@ -2390,8 +2390,6 @@ struct wined3d_surface
UINT pow2Width;
UINT pow2Height;
@ -156,5 +143,5 @@ index 8cce2d9..7efecd4 100644
GLuint rb_resolved;
GLenum texture_target;
--
2.2.1
2.5.1

View File

@ -1,4 +1,4 @@
From 33832b5fb0f7d3c8a0f93d4e3f3d7e1d4de0e6df Mon Sep 17 00:00:00 2001
From de1d4bc66eb1356415957721c76db10213d2f48b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 13:08:33 +0200
Subject: wined3d: Don't try to flip sysmem copies in swapchain_present.
@ -7,67 +7,32 @@ This was once an optimization for ddraw applications that mapped the
backbuffer to render movies. It doesn't work any more in the intended
fashion.
---
dlls/wined3d/swapchain.c | 46 +++++++++-------------------------------------
1 file changed, 9 insertions(+), 37 deletions(-)
dlls/wined3d/swapchain.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index e1a5b8a..05f68f7 100644
index cf2543e..3214fe5 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -555,44 +555,16 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
- if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM)
- || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM)))
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
+ /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
+ * and INTEXTURE copies can keep their old content if they have any defined content.
@@ -560,11 +560,13 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
- * If the swapeffect is COPY, the content remains the same.
- *
- * The FLIP swap effect is not implemented yet. We could mark WINED3D_LOCATION_DRAWABLE
- * up to date and hope WGL flipped front and back buffers and read this data into
- * the FBO. Don't bother about this for now. */
+ * If the swapeffect is COPY, the content remains the same. If it is FLIP however,
+ * the texture / sysmem copy needs to be reloaded from the drawable. */
+ if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
{
- /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
- * Doesn't work with render_to_fbo because we're not flipping
- */
-
- if (front->resource.size == back_buffer->resource.size)
- {
- flip_surface(front, back_buffer);
-
- /* Tell the front buffer surface that is has been modified. However,
- * the other locations were preserved during that, so keep the flags.
- * This serves to update the emulated overlay, if any. */
- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- }
- else
- {
- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
- wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
- wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE);
- }
- }
- else
- {
- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
- /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
- * and INTEXTURE copies can keep their old content if they have any defined content.
- * If the swapeffect is COPY, the content remains the same. If it is FLIP however,
- * the texture / sysmem copy needs to be reloaded from the drawable
- */
- if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
- {
- wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
- wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding);
- }
+ {
+ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding);
}
+ }
if (fb->depth_stencil)
{
--
2.1.3
2.5.1

View File

@ -1,4 +1,4 @@
From bcd6f4338c70693ca49ce0775bdd08a2527db255 Mon Sep 17 00:00:00 2001
From 01caa2176ef522267e3d187ff15ad5bf0372cebd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 13:09:58 +0200
Subject: wined3d: Discard the backbuffer in discard presents.
@ -8,11 +8,11 @@ Subject: wined3d: Discard the backbuffer in discard presents.
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 05f68f7..dd7d2c7 100644
index 3214fe5..bb11450 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -557,14 +557,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
@@ -558,14 +558,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
- /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
@ -39,5 +39,5 @@ index 05f68f7..dd7d2c7 100644
if (fb->depth_stencil)
--
2.1.3
2.5.1

View File

@ -1,115 +1,25 @@
From 883b523131797cfb6e3c715ff8018850d48734a6 Mon Sep 17 00:00:00 2001
From 82924b72e422eb595162fd0b54ca93dd2ef540c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 6 Aug 2013 17:39:26 +0200
Subject: wined3d: Send flips through the command stream
TODO: This remove this patch and flip_surface / surface_flip.
---
dlls/wined3d/surface.c | 77 ------------------------------------------
dlls/wined3d/wined3d_private.h | 2 +-
2 files changed, 1 insertion(+), 78 deletions(-)
dlls/wined3d/wined3d_private.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b19355c..0c3313d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2758,83 +2758,6 @@ void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl
}
}
-void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
-{
- if (front->container->level_count != 1 || front->container->layer_count != 1
- || back->container->level_count != 1 || back->container->layer_count != 1)
- ERR("Flip between surfaces %p and %p not supported.\n", front, back);
-
- /* Flip the surface contents */
- /* Flip the DC */
- {
- HDC tmp;
- tmp = front->hDC;
- front->hDC = back->hDC;
- back->hDC = tmp;
- }
-
- /* Flip the DIBsection */
- {
- HBITMAP tmp = front->dib.DIBsection;
- front->dib.DIBsection = back->dib.DIBsection;
- back->dib.DIBsection = tmp;
- }
-
- /* Flip the surface data */
- {
- void* tmp;
-
- tmp = front->resource.bitmap_data;
- front->resource.bitmap_data = back->resource.bitmap_data;
- back->resource.bitmap_data = tmp;
-
- tmp = front->resource.heap_memory;
- front->resource.heap_memory = back->resource.heap_memory;
- back->resource.heap_memory = tmp;
- }
-
- /* Flip the PBO */
- {
- GLuint tmp_pbo = front->resource.buffer_object;
- front->resource.buffer_object = back->resource.buffer_object;
- back->resource.buffer_object = tmp_pbo;
- }
-
- /* Flip the opengl texture */
- {
- GLuint tmp;
-
- tmp = back->container->texture_rgb.name;
- back->container->texture_rgb.name = front->container->texture_rgb.name;
- front->container->texture_rgb.name = tmp;
-
- tmp = back->container->texture_srgb.name;
- back->container->texture_srgb.name = front->container->texture_srgb.name;
- front->container->texture_srgb.name = tmp;
-
- tmp = back->rb_multisample;
- back->rb_multisample = front->rb_multisample;
- front->rb_multisample = tmp;
-
- tmp = back->rb_resolved;
- back->rb_resolved = front->rb_resolved;
- front->rb_resolved = tmp;
-
- resource_unload(&back->resource);
- resource_unload(&front->resource);
- }
-
- {
- DWORD tmp_flags = back->flags;
- back->flags = front->flags;
- front->flags = tmp_flags;
-
- tmp_flags = back->resource.locations;
- back->resource.locations = front->resource.locations;
- front->resource.locations = tmp_flags;
- }
-}
-
/* 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,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b9eee2c..a2bee4d 100644
index 1534a63..95e1f13 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2424,7 +2424,7 @@ BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect
@@ -2505,6 +2505,7 @@ BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
-void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN;
+void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN;
/* Surface flags: */
#define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */
--
2.1.3
2.5.1

View File

@ -105,58 +105,28 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
/* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */
gl_info->gl_ops.wgl.p_wglSwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */
@@ -539,6 +590,7 @@
}
@@ -540,6 +591,7 @@
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
+#if defined(STAGING_CSMT)
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
switch (swapchain->desc.swap_effect)
@@ -567,6 +619,61 @@
@@ -568,6 +620,31 @@
{
wined3d_surface_decref(swapchain->device->cs->onscreen_depth_stencil);
swapchain->device->cs->onscreen_depth_stencil = NULL;
+#else /* STAGING_CSMT */
+ if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM)
+ || (back_buffer->locations & WINED3D_LOCATION_SYSMEM)))
+ {
+ /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
+ * Doesn't work with render_to_fbo because we're not flipping
+ */
+
+ if (front->resource.size == back_buffer->resource.size)
+ {
+ flip_surface(front, back_buffer);
+
+ /* Tell the front buffer surface that is has been modified. However,
+ * the other locations were preserved during that, so keep the flags.
+ * This serves to update the emulated overlay, if any. */
+ surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ }
+ else
+ {
+ surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE);
+ surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
+ }
+ }
+ else
+ {
+ surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
+ * and INTEXTURE copies can keep their old content if they have any defined content.
+ * If the swapeffect is COPY, the content remains the same. If it is FLIP however,
+ * the texture / sysmem copy needs to be reloaded from the drawable
+ */
+ if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
+ {
+ surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding);
+ surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
+ }
+ }
+ surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
+ * and INTEXTURE copies can keep their old content if they have any defined content.
+ * If the swapeffect is COPY, the content remains the same.
+ *
+ * The FLIP swap effect is not implemented yet. We could mark WINED3D_LOCATION_DRAWABLE
+ * up to date and hope WGL flipped front and back buffers and read this data into
+ * the FBO. Don't bother about this for now. */
+
+ if (fb->depth_stencil)
+ {
@ -175,7 +145,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
}
}
}
@@ -599,7 +706,11 @@
@@ -600,7 +677,11 @@
TRACE("Copying surface %p to screen.\n", front);
@ -187,7 +157,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
src_dc = front->hDC;
window = swapchain->win_handle;
@@ -627,8 +738,12 @@
@@ -628,8 +709,12 @@
}
static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in,
@ -200,7 +170,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
{
struct wined3d_surface *front, *back;
@@ -655,9 +770,15 @@
@@ -656,9 +741,15 @@
{
void *tmp;
@ -216,7 +186,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
if (front->resource.heap_memory)
ERR("GDI Surface %p has heap memory allocated.\n", front);
@@ -728,6 +849,7 @@
@@ -729,6 +820,7 @@
swapchain->render_to_fbo = TRUE;
}
@ -224,7 +194,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
const struct wined3d_adapter *adapter = device->adapter;
@@ -791,6 +913,7 @@
@@ -792,6 +884,7 @@
return WINED3D_OK;
}
@ -232,7 +202,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device,
struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
@@ -881,8 +1004,13 @@
@@ -882,8 +975,13 @@
front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
if (!(device->wined3d->flags & WINED3D_NO3D))
{
@ -246,7 +216,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
}
/* MSDN says we're only allowed a single fullscreen swapchain per device,
@@ -908,9 +1036,66 @@
@@ -909,9 +1007,66 @@
if (!(device->wined3d->flags & WINED3D_NO3D))
{
@ -2167,7 +2137,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
@@ -2545,6 +2704,21 @@
@@ -2545,6 +2704,20 @@
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN;
@ -2184,12 +2154,11 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
+
+void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
+ const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
+void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN;
+#endif /* STAGING_CSMT */
/* Surface flags: */
#define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */
@@ -2564,8 +2738,10 @@
@@ -2564,8 +2737,10 @@
GLuint name;
};
@ -2200,7 +2169,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_vertex_declaration_element
{
const struct wined3d_format *format;
@@ -2594,8 +2770,10 @@
@@ -2594,8 +2769,10 @@
BOOL half_float_conv_needed;
};
@ -2211,7 +2180,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_saved_states
{
DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1];
@@ -2663,6 +2841,7 @@
@@ -2663,6 +2840,7 @@
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -2219,7 +2188,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info,
const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN;
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
@@ -2713,6 +2892,32 @@
@@ -2713,6 +2891,32 @@
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context,
struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN;
@ -2252,7 +2221,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
@@ -2762,6 +2967,7 @@
@@ -2762,6 +2966,7 @@
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
@ -2260,7 +2229,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants,
UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
@@ -2825,6 +3031,7 @@
@@ -2825,6 +3030,7 @@
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
unsigned int depth_pitch) DECLSPEC_HIDDEN;
@ -2268,7 +2237,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
@@ -2839,8 +3046,12 @@
@@ -2839,8 +3045,12 @@
struct wined3d_query_ops
{
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
@ -2281,7 +2250,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_query
@@ -2854,12 +3065,16 @@
@@ -2854,12 +3064,16 @@
enum wined3d_query_type type;
DWORD data_size;
void *extendedData;
@ -2298,7 +2267,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
* fixed function semantics as D3DCOLOR or FLOAT16 */
@@ -2886,7 +3101,9 @@
@@ -2886,7 +3100,9 @@
GLenum buffer_object_usage;
GLenum buffer_type_hint;
DWORD flags;
@ -2308,7 +2277,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *map_ptr;
struct wined3d_map_range *maps;
@@ -2911,11 +3128,15 @@
@@ -2911,11 +3127,15 @@
BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN;
void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context,
const struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -2324,7 +2293,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_rendertarget_view
{
@@ -2954,8 +3175,10 @@
@@ -2954,8 +3174,10 @@
return surface_from_resource(resource);
}
@ -2335,7 +2304,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_shader_resource_view
{
LONG refcount;
@@ -2968,8 +3191,12 @@
@@ -2968,8 +3190,12 @@
struct wined3d_swapchain_ops
{
void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect,
@ -2348,7 +2317,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_swapchain
@@ -3008,8 +3235,10 @@
@@ -3008,8 +3234,10 @@
void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@ -2359,7 +2328,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/*****************************************************************************
* Utility function prototypes
@@ -3213,7 +3442,9 @@
@@ -3213,7 +3441,9 @@
void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN;
@ -7828,93 +7797,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Read the framebuffer contents into a texture. Note that this function
@@ -2854,6 +3624,85 @@
}
}
+#if !defined(STAGING_CSMT)
+void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
+{
+ if (front->container->level_count != 1 || front->container->layer_count != 1
+ || back->container->level_count != 1 || back->container->layer_count != 1)
+ ERR("Flip between surfaces %p and %p not supported.\n", front, back);
+
+ /* Flip the surface contents */
+ /* Flip the DC */
+ {
+ HDC tmp;
+ tmp = front->hDC;
+ front->hDC = back->hDC;
+ back->hDC = tmp;
+ }
+
+ /* Flip the DIBsection */
+ {
+ HBITMAP tmp = front->dib.DIBsection;
+ front->dib.DIBsection = back->dib.DIBsection;
+ back->dib.DIBsection = tmp;
+ }
+
+ /* Flip the surface data */
+ {
+ void* tmp;
+
+ tmp = front->dib.bitmap_data;
+ front->dib.bitmap_data = back->dib.bitmap_data;
+ back->dib.bitmap_data = tmp;
+
+ tmp = front->resource.heap_memory;
+ front->resource.heap_memory = back->resource.heap_memory;
+ back->resource.heap_memory = tmp;
+ }
+
+ /* Flip the PBO */
+ {
+ GLuint tmp_pbo = front->pbo;
+ front->pbo = back->pbo;
+ back->pbo = tmp_pbo;
+ }
+
+ /* Flip the opengl texture */
+ {
+ GLuint tmp;
+
+ tmp = back->container->texture_rgb.name;
+ back->container->texture_rgb.name = front->container->texture_rgb.name;
+ front->container->texture_rgb.name = tmp;
+
+ tmp = back->container->texture_srgb.name;
+ back->container->texture_srgb.name = front->container->texture_srgb.name;
+ front->container->texture_srgb.name = tmp;
+
+ tmp = back->rb_multisample;
+ back->rb_multisample = front->rb_multisample;
+ front->rb_multisample = tmp;
+
+ tmp = back->rb_resolved;
+ back->rb_resolved = front->rb_resolved;
+ front->rb_resolved = tmp;
+
+ resource_unload(&back->resource);
+ resource_unload(&front->resource);
+ }
+
+ {
+ DWORD tmp_flags = back->flags;
+ back->flags = front->flags;
+ front->flags = tmp_flags;
+
+ tmp_flags = back->locations;
+ back->locations = front->locations;
+ front->locations = tmp_flags;
+ }
+}
+
+#endif /* STAGING_CSMT */
/* 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,
@@ -2960,8 +3809,13 @@
@@ -2960,8 +3730,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. */
@ -7928,7 +7811,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Uses the hardware to stretch and flip the image */
@@ -3029,7 +3883,11 @@
@@ -3029,7 +3804,11 @@
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@ -7940,7 +7823,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
@@ -3226,6 +4084,7 @@
@@ -3226,6 +4005,7 @@
checkGLcall("glDeleteTextures(1, &backup)");
}
@ -7948,7 +7831,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)
@@ -3237,6 +4096,17 @@
@@ -3237,6 +4017,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);
@ -7966,7 +7849,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Front buffer coordinates are always full screen coordinates, but our GL
@@ -3267,6 +4137,7 @@
@@ -3267,6 +4058,7 @@
rect->bottom = drawable_height - rect->bottom;
}
@ -7974,7 +7857,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,
@@ -3301,6 +4172,26 @@
@@ -3301,6 +4093,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. */
@ -8001,7 +7884,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 */
@@ -3343,6 +4234,7 @@
@@ -3343,6 +4155,7 @@
/* Leave the opengl state valid for blitting */
device->blitter->unset_shader(context->gl_info);
@ -8009,7 +7892,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
@@ -3356,6 +4248,14 @@
@@ -3356,6 +4169,14 @@
context = context_acquire(device, restore_rt);
context_release(context);
}
@ -8024,7 +7907,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)
@@ -3379,8 +4279,13 @@
@@ -3379,8 +4200,13 @@
enum wined3d_texture_filter_type filter)
{
struct wined3d_device *device = dst_surface->resource.device;
@ -8038,7 +7921,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),
@@ -3571,6 +4476,7 @@
@@ -3571,6 +4397,7 @@
{
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
@ -8046,7 +7929,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)))
@@ -3579,6 +4485,15 @@
@@ -3579,6 +4406,15 @@
surface->ds_current_size.cx = w;
surface->ds_current_size.cy = h;
surface->resource.locations = location;
@ -8062,7 +7945,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
/* Context activation is done by the caller. */
@@ -3593,7 +4508,11 @@
@@ -3593,7 +4429,11 @@
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
@ -8074,7 +7957,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;
@@ -3619,7 +4538,11 @@
@@ -3619,7 +4459,11 @@
return;
}
@ -8086,7 +7969,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
TRACE("Surface was discarded, no need copy data.\n");
switch (location)
@@ -3639,6 +4562,7 @@
@@ -3639,6 +4483,7 @@
default:
FIXME("Unhandled location %#x\n", location);
}
@ -8094,7 +7977,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;
@@ -3650,6 +4574,19 @@
@@ -3650,6 +4495,19 @@
{
FIXME("No up to date depth stencil location.\n");
surface->resource.locations |= location;
@ -8114,7 +7997,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;
@@ -3714,9 +4651,13 @@
@@ -3714,9 +4572,13 @@
context_invalidate_state(context, STATE_FRAMEBUFFER);
@ -8128,7 +8011,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)
@@ -3732,9 +4673,13 @@
@@ -3732,9 +4594,13 @@
context_invalidate_state(context, STATE_FRAMEBUFFER);
@ -8142,7 +8025,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
@@ -3742,6 +4687,7 @@
@@ -3742,6 +4608,7 @@
ERR("Invalid location (%#x) specified.\n", location);
}
@ -8150,7 +8033,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;
@@ -3787,6 +4733,135 @@
@@ -3787,6 +4654,135 @@
TRACE("Surface was discarded, nothing to do.\n");
return WINED3D_OK;
}
@ -8286,7 +8169,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))
@@ -3796,6 +4871,7 @@
@@ -3796,6 +4792,7 @@
}
surface_get_rect(surface, NULL, &r);
@ -8294,7 +8177,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);
@@ -3864,6 +4940,66 @@
@@ -3864,6 +4861,66 @@
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location,
@ -8361,7 +8244,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
&rect, surface, dst_location, &rect);
return WINED3D_OK;
@@ -3873,6 +5009,7 @@
@@ -3873,6 +4930,7 @@
if (srgb)
{
@ -8369,7 +8252,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)
{
@@ -3907,6 +5044,45 @@
@@ -3907,6 +4965,45 @@
width = surface->resource.width;
wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch);
@ -8415,7 +8298,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -3915,7 +5091,11 @@
@@ -3915,7 +5012,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. */
@ -8427,7 +8310,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
TRACE("Removing the pbo attached to surface %p.\n", surface);
@@ -3924,6 +5104,7 @@
@@ -3924,6 +5025,7 @@
else
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
@ -8435,7 +8318,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);
@@ -3931,6 +5112,14 @@
@@ -3931,6 +5033,14 @@
}
wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data);
@ -8450,7 +8333,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. */
@@ -3945,9 +5134,15 @@
@@ -3945,9 +5055,15 @@
context_release(context);
return E_OUTOFMEMORY;
}
@ -8466,7 +8349,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
data.addr = mem;
}
else if (conversion)
@@ -3967,6 +5162,7 @@
@@ -3967,6 +5083,7 @@
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
@ -8474,7 +8357,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
conversion->convert(data.addr, src_row_pitch, mem, dst_pitch,
width, height, palette, &texture->async.gl_color_key);
src_row_pitch = dst_pitch;
@@ -3999,6 +5195,40 @@
@@ -3999,6 +5116,40 @@
struct wined3d_context *context, DWORD location)
{
struct wined3d_surface *surface = surface_from_resource(resource);
@ -8515,7 +8398,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));
@@ -4006,30 +5236,73 @@
@@ -4006,30 +5157,73 @@
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
@ -8596,7 +8479,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
switch (location)
@@ -4038,6 +5311,7 @@
@@ -4038,6 +5232,7 @@
case WINED3D_LOCATION_USER_MEMORY:
case WINED3D_LOCATION_SYSMEM:
case WINED3D_LOCATION_BUFFER:
@ -8604,7 +8487,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
surface_load_sysmem(surface, context, location);
break;
@@ -4055,6 +5329,24 @@
@@ -4055,6 +5250,24 @@
if (FAILED(hr = surface_load_texture(surface, context,
location == WINED3D_LOCATION_TEXTURE_SRGB)))
return;
@ -8629,7 +8512,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
break;
default:
@@ -4062,12 +5354,21 @@
@@ -4062,12 +5275,21 @@
break;
}
@ -8651,7 +8534,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; }
@@ -4175,6 +5476,7 @@
@@ -4175,6 +5397,7 @@
const RECT *dst_rect, const struct wined3d_color *color)
{
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
@ -8659,7 +8542,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;
@@ -4195,6 +5497,21 @@
@@ -4195,6 +5418,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);
@ -8681,7 +8564,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return WINED3D_OK;
}
@@ -4203,6 +5520,7 @@
@@ -4203,6 +5441,7 @@
const RECT *dst_rect, float depth)
{
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
@ -8689,7 +8572,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;
@@ -4218,6 +5536,20 @@
@@ -4218,6 +5457,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);
@ -8710,7 +8593,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return WINED3D_OK;
}
@@ -4227,8 +5559,10 @@
@@ -4227,8 +5480,10 @@
struct wined3d_surface *dst_surface, const RECT *dst_rect,
const struct wined3d_color_key *color_key)
{
@ -8721,7 +8604,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
/* Blit from offscreen surface to render target */
struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key;
DWORD old_color_key_flags = src_surface->container->async.color_key_flags;
@@ -4237,6 +5571,7 @@
@@ -4237,6 +5492,7 @@
wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key);
@ -8729,7 +8612,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,
!!color_key, src_surface, src_rect, dst_surface, dst_rect);
@@ -4248,6 +5583,17 @@
@@ -4248,6 +5504,17 @@
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);
@ -8747,7 +8630,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
const struct blit_shader ffp_blit = {
@@ -4407,6 +5753,7 @@
@@ -4407,6 +5674,7 @@
const struct wined3d_format *src_format, *dst_format;
unsigned int src_fmt_flags, dst_fmt_flags;
struct wined3d_texture *src_texture = NULL;
@ -8755,7 +8638,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;
@@ -4437,6 +5784,23 @@
@@ -4437,6 +5705,23 @@
wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
src_data = dst_data;
src_row_pitch = dst_row_pitch;
@ -8779,7 +8662,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format = dst_surface->resource.format;
dst_format = src_format;
dst_fmt_flags = dst_surface->container->resource.format_flags;
@@ -4448,12 +5812,14 @@
@@ -4448,12 +5733,14 @@
dst_fmt_flags = dst_surface->container->resource.format_flags;
if (src_surface)
{
@ -8794,7 +8677,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)))
@@ -4464,9 +5830,13 @@
@@ -4464,9 +5751,13 @@
}
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0));
}
@ -8808,7 +8691,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format = src_surface->resource.format;
src_fmt_flags = src_surface->container->resource.format_flags;
}
@@ -4476,8 +5846,12 @@
@@ -4476,8 +5767,12 @@
src_fmt_flags = dst_fmt_flags;
}
@ -8821,7 +8704,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
bpp = dst_surface->resource.format->byte_count;
@@ -4488,12 +5862,24 @@
@@ -4488,12 +5783,24 @@
width = (dst_rect->right - dst_rect->left) * bpp;
if (src_surface)
@ -8846,7 +8729,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS)
{
@@ -4528,7 +5914,11 @@
@@ -4528,7 +5835,11 @@
}
hr = surface_cpu_blt_compressed(sbase, dbuf,
@ -8858,7 +8741,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format, flags, fx);
goto release;
}
@@ -4536,7 +5926,11 @@
@@ -4536,7 +5847,11 @@
/* First, all the 'source-less' blits */
if (flags & WINEDDBLT_COLORFILL)
{
@ -8870,7 +8753,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
flags &= ~WINEDDBLT_COLORFILL;
}
@@ -4585,6 +5979,7 @@
@@ -4585,6 +5900,7 @@
for (y = 0; y < dstheight; ++y)
{
memcpy(dbuf, sbuf, width);
@ -8878,7 +8761,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
sbuf += src_row_pitch;
dbuf += dst_row_pitch;
}
@@ -4598,6 +5993,21 @@
@@ -4598,6 +5914,21 @@
{
sbuf -= src_row_pitch;
dbuf -= dst_row_pitch;
@ -8900,7 +8783,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
memcpy(dbuf, sbuf, width);
}
}
@@ -4607,8 +6017,13 @@
@@ -4607,8 +5938,13 @@
for (y = 0; y < dstheight; ++y)
{
memmove(dbuf, sbuf, width);
@ -8914,7 +8797,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -4617,9 +6032,15 @@
@@ -4617,9 +5953,15 @@
/* Stretching in y direction only. */
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8930,7 +8813,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -4629,6 +6050,7 @@
@@ -4629,6 +5971,7 @@
int last_sy = -1;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8938,7 +8821,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))
@@ -4636,6 +6058,15 @@
@@ -4636,6 +5979,15 @@
/* This source row is the same as last source row -
* Copy the already stretched row. */
memcpy(dbuf, dbuf - dst_row_pitch, width);
@ -8954,7 +8837,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
else
{
@@ -4682,6 +6113,7 @@
@@ -4682,6 +6034,7 @@
}
#undef STRETCH_ROW
}
@ -8962,7 +8845,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dbuf += dst_row_pitch;
last_sy = sy;
}
@@ -4690,6 +6122,16 @@
@@ -4690,6 +6043,16 @@
else
{
LONG dstyinc = dst_row_pitch, dstxinc = bpp;
@ -8979,7 +8862,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))
@@ -4739,7 +6181,11 @@
@@ -4739,7 +6102,11 @@
LONG tmpxy;
dTopLeft = dbuf;
dTopRight = dbuf + ((dstwidth - 1) * bpp);
@ -8991,7 +8874,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp);
if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY)
@@ -4816,6 +6262,7 @@
@@ -4816,6 +6183,7 @@
flags &= ~(WINEDDBLT_DDFX);
}
@ -8999,7 +8882,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
#define COPY_COLORKEY_FX(type) \
do { \
const type *s; \
@@ -4837,6 +6284,29 @@
@@ -4837,6 +6205,29 @@
d = (type *)(((BYTE *)d) + dstyinc); \
} \
} while(0)
@ -9029,7 +8912,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
switch (bpp)
{
@@ -4855,7 +6325,11 @@
@@ -4855,7 +6246,11 @@
BYTE *d = dbuf, *dx;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -9041,7 +8924,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dx = d;
for (x = sx = 0; x < dstwidth; ++x, sx+= xinc)
{
@@ -4886,10 +6360,12 @@
@@ -4886,10 +6281,12 @@
}
}
@ -9054,7 +8937,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
error:
if (flags && FIXME_ON(d3d_surface))
{
@@ -4897,6 +6373,7 @@
@@ -4897,6 +6294,7 @@
}
release:
@ -9062,7 +8945,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);
@@ -4915,6 +6392,14 @@
@@ -4915,6 +6313,14 @@
wined3d_texture_decref(src_texture);
if (context)
context_release(context);
@ -9077,7 +8960,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return hr;
}
@@ -4959,6 +6444,7 @@
@@ -4959,6 +6365,7 @@
cpu_blit_blit_surface,
};
@ -9085,7 +8968,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)
@@ -4966,6 +6452,16 @@
@@ -4966,6 +6373,16 @@
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
struct wined3d_device *device = dst_surface->resource.device;
DWORD src_ds_flags, dst_ds_flags;
@ -9102,7 +8985,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
BOOL scale, convert;
static const DWORD simple_blit = WINEDDBLT_ASYNC
@@ -4976,6 +6472,106 @@
@@ -4976,6 +6393,106 @@
| WINEDDBLT_DEPTHFILL
| WINEDDBLT_DONOTWAIT;
@ -9209,7 +9092,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (!device->d3d_initialized)
{
WARN("D3D not initialized, using fallback.\n");
@@ -5018,8 +6614,13 @@
@@ -5018,8 +6535,13 @@
}
scale = src_surface
@ -9223,7 +9106,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->container->resource.format_flags
@@ -5039,6 +6640,7 @@
@@ -5039,6 +6561,7 @@
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth))
@ -9231,7 +9114,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)))
@@ -5049,6 +6651,24 @@
@@ -5049,6 +6572,24 @@
if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding,
src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect)))
return;
@ -9256,7 +9139,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
else
@@ -5057,8 +6677,13 @@
@@ -5057,8 +6598,13 @@
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
@ -9270,7 +9153,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5079,8 +6704,13 @@
@@ -5079,8 +6625,13 @@
palette, fx->u5.dwFillColor, &color))
goto fallback;
@ -9284,7 +9167,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
else
{
@@ -5098,8 +6728,13 @@
@@ -5098,8 +6649,13 @@
color_key = &src_surface->container->async.src_blt_color_key;
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY;
}
@ -9298,7 +9181,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
/* Upload */
if (scale)
@@ -5108,6 +6743,7 @@
@@ -5108,6 +6664,7 @@
TRACE("Not doing upload because of format conversion.\n");
else
{
@ -9306,7 +9189,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)))
@@ -5120,6 +6756,15 @@
@@ -5120,6 +6677,15 @@
context_release(context);
}
return;
@ -9322,7 +9205,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -5143,6 +6788,7 @@
@@ -5143,6 +6709,7 @@
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@ -9330,7 +9213,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return;
}
@@ -5348,6 +6994,49 @@
@@ -5348,6 +6915,49 @@
wined3d_surface_location_invalidated,
wined3d_surface_load_location,
};
@ -9380,7 +9263,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)
@@ -5409,7 +7098,11 @@
@@ -5409,7 +7019,11 @@
}
surface->container = container;
@ -9392,7 +9275,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
list_init(&surface->renderbuffers);
list_init(&surface->overlays);
@@ -5441,9 +7134,14 @@
@@ -5441,9 +7055,14 @@
if (surface->resource.map_binding == WINED3D_LOCATION_DIB)
{
wined3d_resource_free_sysmem(&surface->resource);
@ -9407,7 +9290,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
return hr;
@@ -5470,7 +7168,11 @@
@@ -5470,7 +7089,11 @@
if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags)))
{
WARN("Failed to initialize surface, returning %#x.\n", hr);

View File

@ -1,167 +0,0 @@
From 0fe24554c569c1c99248015e6ecb3af3e7cc5c17 Mon Sep 17 00:00:00 2001
From: Bruno Jesus <00cpxxx@gmail.com>
Date: Sat, 13 Dec 2014 17:36:40 -0200
Subject: ws2_32: Try harder to get the host name address in getaddrinfo()
When the host name is not resolvable getaddrinfo/GetAddrInfoW will
fail, this is not expected for some applications like League of
Legends [1][2][3]. We can deal with this in two ways:
- Try harder and use a NULL name to resolve the localhost address
(user transparent).
- Just warn the user and give up (requires the user to understand the
issue and fix /etc/hosts).
This patch tries harder and at the same time warns the user.
Tested on PC-BSD 9 and Debian 7 by removing the host name in /etc/hosts.
Fixes bug https://bugs.winehq.org/show_bug.cgi?id=29609 for some people.
[1] https://bugs.winehq.org/show_bug.cgi?id=29609#c10
[2] https://bugs.winehq.org/show_bug.cgi?id=29609#c13
[3] http://www.playonlinux.com/fr/topic-10056-League_of_Legends_crash_after_champ_select.html
---
dlls/ws2_32/socket.c | 18 +++++++++++++-----
dlls/ws2_32/tests/sock.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 5 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index faf2ec1..311295d 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -5624,7 +5624,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
struct addrinfo *unixaires = NULL;
int result;
struct addrinfo unixhints, *punixhints = NULL;
- char *hostname = NULL;
+ char *hostname;
const char *node;
*res = NULL;
@@ -5634,13 +5634,13 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
return WSAHOST_NOT_FOUND;
}
+ hostname = get_hostname();
+ if (!hostname) return WSA_NOT_ENOUGH_MEMORY;
+
if (!nodename)
node = NULL;
else if (!nodename[0])
- {
- node = hostname = get_hostname();
- if (!node) return WSA_NOT_ENOUGH_MEMORY;
- }
+ node = hostname;
else
node = nodename;
@@ -5684,6 +5684,14 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
/* getaddrinfo(3) is thread safe, no need to wrap in CS */
result = getaddrinfo(node, servname, punixhints, &unixaires);
+ if (result && !strcmp(hostname, node))
+ {
+ /* If it didn't work it means the host name IP is not in /etc/hosts, try again
+ * by sending a NULL host and avoid sending a NULL servname too because that
+ * is invalid */
+ ERR_(winediag)("Failed to resolve your host name IP, attempting to resolve as NULL. You should fix this!\n");
+ result = getaddrinfo(NULL, servname ? servname : "0", punixhints, &unixaires);
+ }
TRACE("%s, %s %p -> %p %d\n", debugstr_a(nodename), debugstr_a(servname), hints, res, result);
HeapFree(GetProcessHeap(), 0, hostname);
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 7288b5c..08d5b88 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -5871,12 +5871,17 @@ static void test_GetAddrInfoW(void)
static const WCHAR zero[] = {'0',0};
int i, ret;
ADDRINFOW *result, *result2, *p, hint;
+ char computernameA[256];
+ WCHAR computername[sizeof(computernameA)];
if (!pGetAddrInfoW || !pFreeAddrInfoW)
{
win_skip("GetAddrInfoW and/or FreeAddrInfoW not present\n");
return;
}
+ ret = gethostname(computernameA, sizeof(computernameA));
+ ok(!ret, "Expected gethostname to work\n");
+ MultiByteToWideChar(CP_ACP, 0, computernameA, -1, computername, sizeof(computernameA));
memset(&hint, 0, sizeof(ADDRINFOW));
result = (ADDRINFOW *)0xdeadbeef;
@@ -5941,6 +5946,25 @@ static void test_GetAddrInfoW(void)
ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
pFreeAddrInfoW(result);
+ ret = pGetAddrInfoW(computername, NULL, NULL, &result);
+ ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
+ pFreeAddrInfoW(result);
+
+ result = NULL;
+ ret = pGetAddrInfoW(computername, empty, NULL, &result);
+ ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
+ pFreeAddrInfoW(result);
+
+ result = NULL;
+ ret = pGetAddrInfoW(computername, zero, NULL, &result);
+ ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
+ pFreeAddrInfoW(result);
+
+ result = NULL;
+ ret = pGetAddrInfoW(computername, port, NULL, &result);
+ ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
+ pFreeAddrInfoW(result);
+
result = NULL;
ret = pGetAddrInfoW(localhost, NULL, &hint, &result);
ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
@@ -6033,12 +6057,15 @@ static void test_getaddrinfo(void)
{
int i, ret;
ADDRINFOA *result, *result2, *p, hint;
+ char computername[256];
if (!pgetaddrinfo || !pfreeaddrinfo)
{
win_skip("getaddrinfo and/or freeaddrinfo not present\n");
return;
}
+ ret = gethostname(computername, sizeof(computername));
+ ok(!ret, "Expected gethostname to work\n");
memset(&hint, 0, sizeof(ADDRINFOA));
result = (ADDRINFOA *)0xdeadbeef;
@@ -6105,6 +6132,26 @@ static void test_getaddrinfo(void)
pfreeaddrinfo(result);
result = NULL;
+ ret = pgetaddrinfo(computername, NULL, NULL, &result);
+ ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
+ pfreeaddrinfo(result);
+
+ result = NULL;
+ ret = pgetaddrinfo(computername, "", NULL, &result);
+ ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
+ pfreeaddrinfo(result);
+
+ result = NULL;
+ ret = pgetaddrinfo(computername, "0", NULL, &result);
+ ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
+ pfreeaddrinfo(result);
+
+ result = NULL;
+ ret = pgetaddrinfo(computername, "80", NULL, &result);
+ ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
+ pfreeaddrinfo(result);
+
+ result = NULL;
ret = pgetaddrinfo("localhost", NULL, &hint, &result);
ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
pfreeaddrinfo(result);
--
2.2.1

View File

@ -1 +0,0 @@
Fixes: [29609] Try harder to get the host name address in getaddrinfo()