Added patch to revert "Prepare GL resources before calling context_apply_fbo_state".

This commit is contained in:
Sebastian Lackner 2015-11-10 03:28:48 +01:00
parent 0696c2c351
commit 6a3ea0e976
14 changed files with 780 additions and 501 deletions

View File

@ -34,6 +34,11 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [1]:**
* Revert patch to prepare GL resources before calling context_apply_fbo_state ([Wine Bug #39536](https://bugs.winehq.org/show_bug.cgi?id=39536))
**Bug fixes and features in Wine Staging 1.7.54 [268]:**
*Note: The following list only contains features and bug fixes which are not

2
debian/changelog vendored
View File

@ -1,4 +1,6 @@
wine-staging (1.7.55) UNRELEASED; urgency=low
* Added patch to revert "Prepare GL resources before calling
context_apply_fbo_state".
* Remove disabled shell32-Quoted_ShellExecute patchset (bug already fixed and
all tests pass).
* Remove disabled reg-Cleanup patchset (only cleanup and not actively

View File

@ -299,6 +299,7 @@ patch_enable_all ()
enable_wined3d_MESA_GPU_Info="$1"
enable_wined3d_Multisampling="$1"
enable_wined3d_Revert_PixelFormat="$1"
enable_wined3d_Revert_Prepare_GL_Resources="$1"
enable_wined3d_UnhandledBlendFactor="$1"
enable_wined3d_resource_check_usage="$1"
enable_wined3d_wined3d_swapchain_present="$1"
@ -994,6 +995,9 @@ patch_enable ()
wined3d-Revert_PixelFormat)
enable_wined3d_Revert_PixelFormat="$2"
;;
wined3d-Revert_Prepare_GL_Resources)
enable_wined3d_Revert_Prepare_GL_Resources="$2"
;;
wined3d-UnhandledBlendFactor)
enable_wined3d_UnhandledBlendFactor="$2"
;;
@ -1743,9 +1747,13 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
if test "$enable_wined3d_DXTn" -gt 1; then
abort "Patchset wined3d-DXTn disabled, but wined3d-CSMT_Helper depends on that."
fi
if test "$enable_wined3d_Revert_Prepare_GL_Resources" -gt 1; then
abort "Patchset wined3d-Revert_Prepare_GL_Resources disabled, but wined3d-CSMT_Helper depends on that."
fi
enable_makedep_PARENTSPEC=1
enable_ntdll_DllRedirects=1
enable_wined3d_DXTn=1
enable_wined3d_Revert_Prepare_GL_Resources=1
fi
if test "$enable_uxtheme_GTK_Theming" -eq 1; then
@ -5597,10 +5605,27 @@ if test "$enable_wined3d_Accounting" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-Revert_Prepare_GL_Resources
# |
# | This patchset fixes the following Wine bugs:
# | * [#39536] Revert patch to prepare GL resources before calling context_apply_fbo_state
# |
# | Modified files:
# | * dlls/wined3d/context.c, dlls/wined3d/device.c, dlls/wined3d/drawprim.c, dlls/wined3d/surface.c,
# | dlls/wined3d/wined3d_private.h
# |
if test "$enable_wined3d_Revert_Prepare_GL_Resources" -eq 1; then
patch_apply wined3d-Revert_Prepare_GL_Resources/0001-Revert-wined3d-Prepare-GL-resources-before-calling-c.patch
(
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Prepare GL resources before calling context_apply_fbo_state.\".", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-CSMT_Helper
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d-
# | Revert_Prepare_GL_Resources
# |
# | Modified files:
# | * configure.ac, dlls/d3d11/device.c, dlls/d3d11/texture.c, dlls/d3d8/surface.c, dlls/d3d8/volume.c, dlls/d3d9/surface.c,
@ -5736,7 +5761,7 @@ fi
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d-
# | CSMT_Helper
# | Revert_Prepare_GL_Resources, wined3d-CSMT_Helper
# |
# | This patchset fixes the following Wine bugs:
# | * [#11674] Support for CSMT (command stream) to increase graphic performance

View File

@ -1,3 +1,4 @@
Depends: wined3d-DXTn
Depends: wined3d-Revert_Prepare_GL_Resources
Depends: makedep-PARENTSPEC
Depends: ntdll-DllRedirects

View File

@ -1,4 +1,4 @@
From 52759529f11102038adaa8501a44b03d9b0024ae Mon Sep 17 00:00:00 2001
From 58c5b8740183684ce7dcb7735e219b13d3a60ddf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 20:25:01 +0100
Subject: wined3d: Make surface_load_location return nothing.
@ -9,10 +9,10 @@ Subject: wined3d: Make surface_load_location return nothing.
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 89c8ecf..0b10444 100644
index ebe8049..dc5d249 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4231,7 +4231,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4257,7 +4257,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
}
/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
@ -21,7 +21,7 @@ index 89c8ecf..0b10444 100644
{
HRESULT hr;
@@ -4243,26 +4243,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4269,26 +4269,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
&& surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
{
surface_load_ds_location(surface, context, location);
@ -52,7 +52,7 @@ index 89c8ecf..0b10444 100644
}
if (WARN_ON(d3d_surface))
@@ -4277,7 +4277,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4303,7 +4303,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
{
ERR("Surface %p does not have any up to date location.\n", surface);
surface->flags |= SFLAG_LOST;
@ -61,7 +61,7 @@ index 89c8ecf..0b10444 100644
}
switch (location)
@@ -4291,7 +4291,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4317,7 +4317,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
case WINED3D_LOCATION_DRAWABLE:
if (FAILED(hr = surface_load_drawable(surface, context)))
@ -70,7 +70,7 @@ index 89c8ecf..0b10444 100644
break;
case WINED3D_LOCATION_RB_RESOLVED:
@@ -4302,7 +4302,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4328,7 +4328,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
case WINED3D_LOCATION_TEXTURE_SRGB:
if (FAILED(hr = surface_load_texture(surface, context,
location == WINED3D_LOCATION_TEXTURE_SRGB)))
@ -79,7 +79,7 @@ index 89c8ecf..0b10444 100644
break;
default:
@@ -4315,7 +4315,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4341,7 +4341,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM))
surface_evict_sysmem(surface);
@ -89,7 +89,7 @@ index 89c8ecf..0b10444 100644
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8bbb1ab..9cff40e 100644
index e9481b5..fac385a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2457,7 +2457,7 @@ void surface_load_ds_location(struct wined3d_surface *surface,
@ -100,7 +100,7 @@ index 8bbb1ab..9cff40e 100644
+void surface_load_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context,
void surface_prepare_rb(struct wined3d_surface *surface,
--
2.6.1
2.6.2

View File

@ -1,4 +1,4 @@
From aaf34c4edb4e96dc735ca43288c26d46501b9a5d Mon Sep 17 00:00:00 2001
From d0e2c459cceb86d34019f95a6ec9910eaeba00f9 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.
@ -25,7 +25,7 @@ index 9ac6666..d576869 100644
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d00f263..5e43d07 100644
index 0da8607..b6c98ef 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
@ -47,10 +47,10 @@ index d00f263..5e43d07 100644
ds->ds_current_size.cx,
ds->ds_current_size.cy);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 3761830..943a829 100644
index d2d3bce..afccecd 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -655,7 +655,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@@ -651,7 +651,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
device_switch_onscreen_ds(device, context, ds);
@ -60,7 +60,7 @@ index 3761830..943a829 100644
else
SetRectEmpty(&current_rect);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0b10444..8292ead 100644
index dc5d249..e937e36 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)
@ -90,7 +90,7 @@ index 0b10444..8292ead 100644
{
TRACE("Not dirtified, nothing to do.\n");
return;
@@ -1670,7 +1670,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1680,7 +1680,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
@ -99,7 +99,7 @@ index 0b10444..8292ead 100644
wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect,
@@ -1793,7 +1793,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
@@ -1803,7 +1803,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
if (surface->resource.pool == WINED3D_POOL_SCRATCH)
ERR("Not supported on scratch surfaces.\n");
@ -108,7 +108,7 @@ index 0b10444..8292ead 100644
{
TRACE("surface is already in texture\n");
return;
@@ -2059,7 +2059,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2069,7 +2069,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
create_dib = TRUE;
}
@ -117,7 +117,7 @@ index 0b10444..8292ead 100644
wined3d_resource_free_sysmem(&surface->resource);
width = texture_resource->width;
@@ -3235,7 +3235,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3245,7 +3245,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 */
@ -126,7 +126,7 @@ index 0b10444..8292ead 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3762,13 +3762,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
@@ -3772,13 +3772,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);
@ -144,7 +144,7 @@ index 0b10444..8292ead 100644
}
/* Context activation is done by the caller. */
@@ -3783,7 +3784,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3793,7 +3794,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;
@ -153,7 +153,7 @@ index 0b10444..8292ead 100644
{
w = surface->ds_current_size.cx;
h = surface->ds_current_size.cy;
@@ -3809,21 +3810,21 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3819,7 +3820,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return;
}
@ -161,7 +161,11 @@ index 0b10444..8292ead 100644
+ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Surface was discarded, no need copy data.\n");
wined3d_surface_prepare(surface, context, location);
switch (location)
@@ -3839,17 +3840,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
default:
FIXME("Unhandled location %#x\n", location);
}
- surface->locations &= ~WINED3D_LOCATION_DISCARDED;
- surface->locations |= location;
+ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED;
@ -180,7 +184,7 @@ index 0b10444..8292ead 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
@@ -3911,7 +3912,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3937,7 +3938,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
ERR("Invalid location (%#x) specified.\n", location);
}
@ -189,7 +193,7 @@ index 0b10444..8292ead 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
}
@@ -3920,7 +3921,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
@@ -3946,7 +3947,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@ -198,7 +202,7 @@ index 0b10444..8292ead 100644
}
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
@@ -3929,9 +3930,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
@@ -3955,9 +3956,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);
@ -210,7 +214,7 @@ index 0b10444..8292ead 100644
ERR("Surface %p does not have any up to date location.\n", surface);
}
@@ -3967,7 +3968,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -3993,7 +3994,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
UINT size = surface->resource.size;
surface_get_memory(surface, &dst, location);
@ -219,7 +223,7 @@ index 0b10444..8292ead 100644
if (dst.buffer_object)
{
@@ -4000,33 +4001,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4026,33 +4027,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -259,7 +263,7 @@ index 0b10444..8292ead 100644
}
/* Context activation is done by the caller. */
@@ -4066,14 +4067,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4092,14 +4093,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource)
@ -276,7 +280,7 @@ index 0b10444..8292ead 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,
@@ -4089,13 +4090,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4115,13 +4116,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
@ -292,7 +296,7 @@ index 0b10444..8292ead 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};
@@ -4110,7 +4111,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4136,7 +4137,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (srgb)
{
@ -301,7 +305,7 @@ index 0b10444..8292ead 100644
== WINED3D_LOCATION_TEXTURE_RGB)
{
/* Performance warning... */
@@ -4121,7 +4122,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4147,7 +4148,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
else
{
@ -310,7 +314,7 @@ index 0b10444..8292ead 100644
== WINED3D_LOCATION_TEXTURE_SRGB)
{
/* Performance warning... */
@@ -4131,7 +4132,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4157,7 +4158,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
}
@ -319,7 +323,7 @@ index 0b10444..8292ead 100644
{
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
@@ -4166,7 +4167,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4192,7 +4193,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@ -328,7 +332,7 @@ index 0b10444..8292ead 100644
if (format.convert)
{
/* This code is entered for texture formats which need a fixup. */
@@ -4222,7 +4223,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4248,7 +4249,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
{
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@ -337,7 +341,7 @@ index 0b10444..8292ead 100644
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
@@ -4240,12 +4241,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4266,12 +4267,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
@ -352,7 +356,7 @@ index 0b10444..8292ead 100644
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
{
/* Already up to date, nothing to do. */
@@ -4254,12 +4255,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4280,12 +4281,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",
@ -367,7 +371,7 @@ index 0b10444..8292ead 100644
{
TRACE("Location already up to date.\n");
return;
@@ -4273,7 +4274,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4299,7 +4300,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
required_access, surface->resource.access_flags);
}
@ -376,7 +380,7 @@ index 0b10444..8292ead 100644
{
ERR("Surface %p does not have any up to date location.\n", surface);
surface->flags |= SFLAG_LOST;
@@ -4312,7 +4313,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4338,7 +4339,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
surface_validate_location(surface, location);
@ -385,7 +389,7 @@ index 0b10444..8292ead 100644
surface_evict_sysmem(surface);
return;
@@ -5364,8 +5365,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5390,8 +5391,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. */
@ -396,7 +400,7 @@ index 0b10444..8292ead 100644
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5405,8 +5406,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
color_key = &src_surface->container->async.src_blt_color_key;
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY;
}
@ -408,7 +412,7 @@ index 0b10444..8292ead 100644
/* Upload */
if (scale)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index af6c46e..8e120df 100644
index f42325e..2a23afc 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2401,7 +2401,6 @@ struct wined3d_surface
@ -420,5 +424,5 @@ index af6c46e..8e120df 100644
DWORD flags;
--
2.6.1
2.6.2

View File

@ -1,4 +1,4 @@
From e8c231756407f3846d3247cd4f01955d9e5a757d Mon Sep 17 00:00:00 2001
From 855de6d9c2e7e1254123141eb8962061e1234d0a 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.
@ -28,10 +28,10 @@ index d080585..9a882cc 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 978f7d7..8ec2964 100644
index 97f3c04..abc41dc 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3288,7 +3288,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
@@ -3295,7 +3295,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
if (texture->texture_srgb.name)
wined3d_texture_load(texture, context, TRUE);
wined3d_texture_load(texture, context, FALSE);
@ -41,10 +41,10 @@ index 978f7d7..8ec2964 100644
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2226f53..bb133c4 100644
index 86671dd..5f2fa7c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -398,7 +398,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@@ -393,7 +393,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if (rt)
{
wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding);
@ -53,7 +53,7 @@ index 2226f53..bb133c4 100644
}
}
@@ -4016,7 +4016,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4013,7 +4013,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,20 +63,20 @@ index 2226f53..bb133c4 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 943a829..95245a9 100644
index afccecd..d756182 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -628,7 +628,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
@@ -629,7 +629,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if (target)
{
surface_load_location(target, context, target->container->resource.draw_binding);
- surface_invalidate_location(target, ~target->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding);
}
else
{
}
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ce3c439..237a6de 100644
index 596ad5c..307ac96 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -599,7 +599,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
@ -88,7 +88,7 @@ index ce3c439..237a6de 100644
}
static void surface_release_client_storage(struct wined3d_surface *surface)
@@ -1119,7 +1119,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
@@ -1114,7 +1114,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
checkGLcall("glDeleteBuffers(1, &surface->pbo)");
surface->pbo = 0;
@ -97,7 +97,7 @@ index ce3c439..237a6de 100644
}
static ULONG surface_resource_incref(struct wined3d_resource *resource)
@@ -1159,7 +1159,7 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1154,7 +1154,7 @@ static void surface_unload(struct wined3d_resource *resource)
surface_prepare_system_memory(surface);
memset(surface->resource.heap_memory, 0, surface->resource.size);
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
@ -106,7 +106,7 @@ index ce3c439..237a6de 100644
/* We also get here when the ddraw swapchain is destroyed, for example
* for a mode switch. In this case this surface won't necessarily be
@@ -1171,7 +1171,7 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1166,7 +1166,7 @@ static void surface_unload(struct wined3d_resource *resource)
{
surface_prepare_map_memory(surface);
surface_load_location(surface, context, surface->resource.map_binding);
@ -115,7 +115,7 @@ index ce3c439..237a6de 100644
}
/* Destroy PBOs, but load them into real sysmem before */
@@ -1209,7 +1209,10 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1217,7 +1217,10 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso
static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location)
{
@ -127,7 +127,7 @@ index ce3c439..237a6de 100644
}
static const struct wined3d_resource_ops surface_resource_ops =
@@ -1685,7 +1688,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1695,7 +1698,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
@ -136,7 +136,7 @@ index ce3c439..237a6de 100644
return WINED3D_OK;
}
@@ -2701,7 +2704,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2711,7 +2714,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
@ -145,7 +145,7 @@ index ce3c439..237a6de 100644
switch (surface->resource.map_binding)
{
@@ -2817,7 +2820,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2827,7 +2830,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
}
surface_load_location(surface, context, WINED3D_LOCATION_DIB);
@ -154,7 +154,7 @@ index ce3c439..237a6de 100644
if (context)
context_release(context);
@@ -2866,7 +2869,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
@@ -2876,7 +2879,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
context = context_acquire(device, NULL);
surface_load_location(surface, context, surface->resource.map_binding);
@ -163,7 +163,7 @@ index ce3c439..237a6de 100644
if (context)
context_release(context);
}
@@ -3173,7 +3176,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
@@ -3183,7 +3186,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 ce3c439..237a6de 100644
}
/* Uses the hardware to stretch and flip the image */
@@ -3241,7 +3244,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3251,7 +3254,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 ce3c439..237a6de 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3446,7 +3449,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3456,7 +3459,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 ce3c439..237a6de 100644
}
/* Front buffer coordinates are always full screen coordinates, but our GL
@@ -3923,18 +3926,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3949,18 +3952,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 ce3c439..237a6de 100644
static DWORD resource_access_from_location(DWORD location)
{
switch (location)
@@ -4485,7 +4476,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -4511,7 +4502,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 ce3c439..237a6de 100644
}
const struct blit_shader ffp_blit = {
@@ -5466,7 +5457,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5492,7 +5483,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 ce3c439..237a6de 100644
return WINED3D_OK;
}
@@ -5588,7 +5579,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
@@ -5614,7 +5605,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 ce3c439..237a6de 100644
return hr;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 45b69c8..e9fe241 100644
index 9758be4..4e50ef9 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -518,7 +518,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
@ -268,7 +268,7 @@ index 45b69c8..e9fe241 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 2f1df55..64d115c 100644
index 7e31832..be378fc 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -776,7 +776,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
@ -292,7 +292,7 @@ index 2f1df55..64d115c 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 5b4ae99..3b02457 100644
index da39f65..f20121e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2452,7 +2452,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s,
@ -304,5 +304,5 @@ index 5b4ae99..3b02457 100644
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
--
2.6.1
2.6.2

View File

@ -1,4 +1,4 @@
From c733f3af4517be13e6c673cf28fc4df6e09b9f78 Mon Sep 17 00:00:00 2001
From 4c30573555207c5e8fa9518f50c611446c89097c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 20:33:17 +0100
Subject: wined3d: Replace surface_load_location with resource_load_location.
@ -15,10 +15,10 @@ FIXME: Check if this patch is complete enough to make sense.
7 files changed, 46 insertions(+), 89 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 8ec2964..4909344 100644
index abc41dc..a9d6664 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2286,7 +2286,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
@@ -2293,7 +2293,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
@ -28,19 +28,19 @@ index 8ec2964..4909344 100644
swapchain_update_draw_bindings(swapchain);
context_set_render_offscreen(context, TRUE);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 352efc3..4d7fa53 100644
index 5f2fa7c..1dc934d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -323,7 +323,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if (rt && rt->resource.format->id != WINED3DFMT_NULL)
{
if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, clear_rect))
struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]);
if (rt)
- surface_load_location(rt, context, rt->container->resource.draw_binding);
+ wined3d_resource_load_location(&rt->resource, context, rt->container->resource.draw_binding);
else
wined3d_surface_prepare(rt, context, rt->container->resource.draw_binding);
}
@@ -4009,7 +4009,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
}
@@ -4004,7 +4004,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
&& src_rect.bottom == sub_resource->height)
wined3d_texture_prepare_texture(texture, context, FALSE);
else
@ -50,20 +50,20 @@ index 352efc3..4d7fa53 100644
wined3d_surface_upload_data(surface, gl_info, resource->format,
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 95245a9..4b01b7d 100644
index d756182..0e1f4ec 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -627,7 +627,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
{
if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
@@ -628,7 +628,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
if (target)
{
- surface_load_location(target, context, target->container->resource.draw_binding);
+ wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding);
wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding);
}
else
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index fed3aaf..742ebc3 100644
index 0b1716e..c0f7479 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -759,7 +759,7 @@ static void surface_unmap(struct wined3d_surface *surface)
@ -84,10 +84,10 @@ index fed3aaf..742ebc3 100644
if (!surface_is_full_rect(dst_surface, dst_rect))
- surface_load_location(dst_surface, context, dst_location);
+ wined3d_resource_load_location(&dst_surface->resource, context, dst_location);
else
wined3d_surface_prepare(dst_surface, context, dst_location);
@@ -918,9 +918,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
gl_info = context->gl_info;
@@ -916,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
* surface isn't required if the entire surface is overwritten. (And is
* in fact harmful if we're being called by surface_load_location() with
* the purpose of loading the destination surface.) */
@ -96,10 +96,10 @@ index fed3aaf..742ebc3 100644
if (!surface_is_full_rect(dst_surface, &dst_rect))
- surface_load_location(dst_surface, old_ctx, dst_location);
+ wined3d_resource_load_location(&dst_surface->resource, old_ctx, dst_location);
else
wined3d_surface_prepare(dst_surface, old_ctx, dst_location);
@@ -1170,7 +1170,7 @@ static void surface_unload(struct wined3d_resource *resource)
if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
@@ -1165,7 +1165,7 @@ static void surface_unload(struct wined3d_resource *resource)
else
{
surface_prepare_map_memory(surface);
@ -108,7 +108,7 @@ index fed3aaf..742ebc3 100644
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
}
@@ -1228,24 +1228,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
@@ -1223,24 +1223,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
wined3d_texture_set_dirty(surface->container);
}
@ -133,7 +133,7 @@ index fed3aaf..742ebc3 100644
static const struct wined3d_surface_ops surface_ops =
{
surface_private_setup,
@@ -1699,7 +1681,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1694,7 +1676,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
if (update_w == dst_w && update_h == dst_h)
wined3d_texture_prepare_texture(dst_surface->container, context, FALSE);
else
@ -142,7 +142,7 @@ index fed3aaf..742ebc3 100644
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
surface_get_memory(src_surface, &data, src_surface->resource.locations);
@@ -1832,7 +1814,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
@@ -1827,7 +1809,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
}
TRACE("Reloading because surface is dirty.\n");
@ -151,7 +151,7 @@ index fed3aaf..742ebc3 100644
surface_evict_sysmem(surface);
}
@@ -2721,7 +2703,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2716,7 +2698,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if (surface->resource.device->d3d_initialized)
context = context_acquire(surface->resource.device, NULL);
@ -160,7 +160,7 @@ index fed3aaf..742ebc3 100644
if (context)
context_release(context);
}
@@ -2826,7 +2808,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2821,7 +2803,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
{
if (surface->flags & SFLAG_CLIENT)
{
@ -169,7 +169,7 @@ index fed3aaf..742ebc3 100644
surface_release_client_storage(surface);
}
hr = surface_create_dib_section(surface);
@@ -2842,7 +2824,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2837,7 +2819,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
surface->resource.map_binding = WINED3D_LOCATION_DIB;
}
@ -178,7 +178,7 @@ index fed3aaf..742ebc3 100644
wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB);
if (context)
@@ -2891,7 +2873,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
@@ -2886,7 +2868,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
if (device->d3d_initialized)
context = context_acquire(device, NULL);
@ -187,7 +187,7 @@ index fed3aaf..742ebc3 100644
wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB);
if (context)
context_release(context);
@@ -3528,8 +3510,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
@@ -3523,8 +3505,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
gl_info = context->gl_info;
/* Make sure the surface is up-to-date. This should probably use
@ -198,7 +198,7 @@ index fed3aaf..742ebc3 100644
wined3d_texture_load(src_surface->container, context, FALSE);
/* Activate the destination context, set it up for blitting */
@@ -3949,29 +3931,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3960,29 +3942,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
@ -228,7 +228,7 @@ index fed3aaf..742ebc3 100644
static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location)
{
struct wined3d_device *device = surface->resource.device;
@@ -4021,7 +3980,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4032,7 +3991,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
}
if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
@ -237,7 +237,7 @@ index fed3aaf..742ebc3 100644
/* Download the surface to system memory. */
if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
@@ -4057,7 +4016,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
@@ -4068,7 +4027,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
}
surface_get_rect(surface, NULL, &r);
@ -246,7 +246,7 @@ index fed3aaf..742ebc3 100644
surface_blt_to_drawable(surface->resource.device, context,
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
@@ -4130,7 +4089,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4141,7 +4100,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
surface_prepare_map_memory(surface);
@ -255,7 +255,7 @@ index fed3aaf..742ebc3 100644
}
}
else
@@ -4141,7 +4100,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4152,7 +4111,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
surface_prepare_map_memory(surface);
@ -264,7 +264,7 @@ index fed3aaf..742ebc3 100644
}
}
@@ -4150,7 +4109,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4161,7 +4120,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
surface_prepare_system_memory(surface);
@ -273,7 +273,7 @@ index fed3aaf..742ebc3 100644
}
wined3d_texture_prepare_texture(texture, context, srgb);
@@ -4176,7 +4135,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4187,7 +4146,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
surface_prepare_map_memory(surface);
@ -282,7 +282,7 @@ index fed3aaf..742ebc3 100644
surface_remove_pbo(surface, gl_info);
}
@@ -4244,9 +4203,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4255,9 +4214,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
}
@ -296,7 +296,7 @@ index fed3aaf..742ebc3 100644
HRESULT hr;
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4273,20 +4234,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4284,20 +4245,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
}
}
@ -317,7 +317,7 @@ index fed3aaf..742ebc3 100644
if (!surface->resource.locations)
{
ERR("Surface %p does not have any up to date location.\n", surface);
@@ -5436,7 +5383,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5447,7 +5394,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
{
struct wined3d_context *context = context_acquire(device, dst_surface);
@ -327,7 +327,7 @@ index fed3aaf..742ebc3 100644
context_release(context);
}
return WINED3D_OK;
@@ -5509,6 +5457,17 @@ cpu:
@@ -5520,6 +5468,17 @@ cpu:
return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter);
}
@ -346,7 +346,7 @@ index fed3aaf..742ebc3 100644
const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags)
{
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 50cd3ea..6ceac57 100644
index e87a209..b9bf4c1 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -315,7 +315,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
@ -385,7 +385,7 @@ index 50cd3ea..6ceac57 100644
src_dc = front->hDC;
window = swapchain->win_handle;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 7650f36..7e7df06 100644
index 2a183e8..29c7eec 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -774,7 +774,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
@ -398,7 +398,7 @@ index 7650f36..7e7df06 100644
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e970088..c5c1442 100644
index 3a6309c..ff547d3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2460,8 +2460,6 @@ void surface_load_ds_location(struct wined3d_surface *surface,
@ -408,8 +408,8 @@ index e970088..c5c1442 100644
-void surface_load_location(struct wined3d_surface *surface,
- struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context,
DWORD location) DECLSPEC_HIDDEN;
void surface_prepare_rb(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN;
--
2.6.2

View File

@ -1,4 +1,4 @@
From 68280056e300f90beae6bac338aa94ebacaa4bfc Mon Sep 17 00:00:00 2001
From 8831f7064e0757addb08763c263bf7498f8a6f43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 20 Dec 2012 13:09:17 +0100
Subject: wined3d: Move the framebuffer into wined3d_state
@ -42,10 +42,10 @@ index 9a882cc..df89a05 100644
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 6d08df9..104172f 100644
index a9d6664..9f8397f 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1506,6 +1506,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
@@ -1513,6 +1513,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
goto out;
}
@ -58,7 +58,7 @@ index 6d08df9..104172f 100644
/* Initialize the texture unit mapping to a 1:1 mapping */
for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s)
{
@@ -1833,6 +1839,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
@@ -1840,6 +1846,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
out:
device->shader_backend->shader_free_context_data(ret);
device->adapter->fragment_pipe->free_context_data(ret);
@ -66,7 +66,7 @@ index 6d08df9..104172f 100644
HeapFree(GetProcessHeap(), 0, ret->free_event_queries);
HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries);
HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries);
@@ -1867,6 +1874,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
@@ -1874,6 +1881,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
device->shader_backend->shader_free_context_data(context);
device->adapter->fragment_pipe->free_context_data(context);
@ -74,7 +74,7 @@ index 6d08df9..104172f 100644
HeapFree(GetProcessHeap(), 0, context->draw_buffers);
HeapFree(GetProcessHeap(), 0, context->blit_targets);
device_context_remove(device, context);
@@ -2378,7 +2386,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2385,7 +2393,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
DWORD rt_mask = 0, *cur_mask;
UINT i;
@ -83,7 +83,7 @@ index 6d08df9..104172f 100644
|| rt_count != context->gl_info->limits.buffers)
{
if (!context_validate_rt_config(rt_count, rts, dsv))
@@ -2423,6 +2431,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2430,6 +2438,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
rt_mask = context_generate_rt_mask_no_fbo(device,
rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL);
}
@ -92,7 +92,7 @@ index 6d08df9..104172f 100644
}
else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource)))
@@ -2473,7 +2483,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2480,7 +2490,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_device *device)
{
const struct wined3d_state *state = &device->state;
@ -101,7 +101,7 @@ index 6d08df9..104172f 100644
struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL];
DWORD rt_mask, rt_mask_bits;
unsigned int i;
@@ -2503,7 +2513,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
@@ -2510,7 +2520,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_device *device = context->swapchain->device;
@ -110,7 +110,7 @@ index 6d08df9..104172f 100644
DWORD rt_mask = find_draw_buffers_mask(context, device);
DWORD *cur_mask;
@@ -2535,6 +2545,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat
@@ -2542,6 +2552,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat
context_apply_draw_buffers(context, rt_mask);
*cur_mask = rt_mask;
}
@ -119,7 +119,7 @@ index 6d08df9..104172f 100644
}
static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit)
@@ -3159,7 +3171,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
@@ -3166,7 +3178,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
{
const struct wined3d_state *state = &device->state;
const struct StateEntry *state_table = context->state_table;
@ -205,10 +205,10 @@ index 316ccb8..eefa142 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a5c1e59..42c5d14 100644
index 1dc934d..d05ff2d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -865,7 +865,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
@@ -860,7 +860,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil;
unsigned int i;
@ -217,7 +217,7 @@ index a5c1e59..42c5d14 100644
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -883,7 +883,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -878,7 +878,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
struct wined3d_swapchain_desc *swapchain_desc)
{
static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
@ -225,7 +225,7 @@ index a5c1e59..42c5d14 100644
struct wined3d_swapchain *swapchain = NULL;
struct wined3d_context *context;
DWORD clear_flags = 0;
@@ -896,9 +895,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -891,9 +890,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
if (device->wined3d->flags & WINED3D_NO3D)
return WINED3DERR_INVALIDCALL;
@ -235,7 +235,7 @@ index a5c1e59..42c5d14 100644
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
device->adapter->vertex_pipe, device->adapter->fragment_pipe)))
{
@@ -986,7 +982,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -981,7 +977,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
return WINED3D_OK;
err_out:
@ -243,7 +243,7 @@ index a5c1e59..42c5d14 100644
HeapFree(GetProcessHeap(), 0, device->swapchains);
device->swapchain_count = 0;
if (device->back_buffer_view)
@@ -1065,8 +1060,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1060,8 +1055,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
if (device->cursor_texture)
wined3d_texture_decref(device->cursor_texture);
@ -269,7 +269,7 @@ index a5c1e59..42c5d14 100644
/* Unload resources */
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
@@ -1097,37 +1109,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1092,37 +1104,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
* destroy the context. */
context_release(context);
@ -307,7 +307,7 @@ index a5c1e59..42c5d14 100644
if (device->back_buffer_view)
{
wined3d_rendertarget_view_decref(device->back_buffer_view);
@@ -1145,9 +1126,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1140,9 +1121,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
device->swapchains = NULL;
device->swapchain_count = 0;
@ -317,7 +317,7 @@ index a5c1e59..42c5d14 100644
device->d3d_initialized = FALSE;
return WINED3D_OK;
@@ -1943,7 +1921,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
@@ -1938,7 +1916,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
|| !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH))
return;
surface = surface_from_resource(texture->sub_resources[0]);
@ -326,7 +326,7 @@ index a5c1e59..42c5d14 100644
return;
wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT);
@@ -3298,6 +3276,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3293,6 +3271,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
@ -335,7 +335,7 @@ index a5c1e59..42c5d14 100644
TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n",
device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil);
@@ -3309,7 +3289,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3304,7 +3284,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
{
@ -344,7 +344,7 @@ index a5c1e59..42c5d14 100644
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3318,8 +3298,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3313,8 +3293,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
}
else if (flags & WINED3DCLEAR_TARGET)
{
@ -355,7 +355,7 @@ index a5c1e59..42c5d14 100644
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3682,8 +3662,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
@@ -3677,8 +3657,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
@ -366,7 +366,7 @@ index a5c1e59..42c5d14 100644
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -4065,20 +4045,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
@@ -4060,20 +4040,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
return NULL;
}
@ -390,7 +390,7 @@ index a5c1e59..42c5d14 100644
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4118,13 +4099,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4113,13 +4094,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
}
@ -406,7 +406,7 @@ index a5c1e59..42c5d14 100644
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
@@ -4136,18 +4117,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4131,18 +4112,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -428,7 +428,7 @@ index a5c1e59..42c5d14 100644
wined3d_rendertarget_view_incref(view);
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
@@ -4511,10 +4493,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4506,10 +4488,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_texture_decref(device->cursor_texture);
device->cursor_texture = NULL;
}
@ -440,7 +440,7 @@ index a5c1e59..42c5d14 100644
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4523,6 +4504,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4518,6 +4499,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -452,7 +452,7 @@ index a5c1e59..42c5d14 100644
if (device->onscreen_depth_stencil)
{
wined3d_texture_decref(device->onscreen_depth_stencil->container);
@@ -4741,7 +4727,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4736,7 +4722,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (device->d3d_initialized)
delete_opengl_contexts(device, swapchain);
@ -461,7 +461,7 @@ index a5c1e59..42c5d14 100644
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize device state, hr %#x.\n", hr);
device->update_state = &device->state;
@@ -4750,22 +4736,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4745,22 +4731,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
else if (device->back_buffer_view)
{
@ -489,7 +489,7 @@ index a5c1e59..42c5d14 100644
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -4853,17 +4838,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -4848,17 +4833,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -511,7 +511,7 @@ index a5c1e59..42c5d14 100644
}
}
break;
@@ -5026,7 +5011,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
@@ -5021,7 +5006,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device->blitter = adapter->blitter;
@ -521,7 +521,7 @@ index a5c1e59..42c5d14 100644
{
ERR("Failed to initialize device state, hr %#x.\n", hr);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 4b01b7d..7e3a7f7 100644
index 0e1f4ec..17054c1 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -611,7 +611,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -533,16 +533,16 @@ index 4b01b7d..7e3a7f7 100644
if (!context->valid)
{
context_release(context);
@@ -622,7 +622,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
+ struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(state->fb.render_targets[i]);
if (target && target->resource.format->id != WINED3DFMT_NULL)
@@ -625,7 +625,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
/* Invalidate the back buffer memory so LockRect will read it the next time */
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
@@ -637,16 +637,16 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
+ struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(state->fb.render_targets[i]);
if (target)
{
wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding);
@@ -634,18 +634,18 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
}
}
@ -557,12 +557,14 @@ index 4b01b7d..7e3a7f7 100644
- DWORD location = context->render_offscreen ? device->fb.depth_stencil->resource->draw_binding
+ DWORD location = context->render_offscreen ? state->fb.depth_stencil->resource->draw_binding
: WINED3D_LOCATION_DRAWABLE;
- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil);
+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil);
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
{
@@ -679,9 +679,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil);
+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil);
RECT current_rect, draw_rect, r;
if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
@@ -671,9 +671,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
return;
}
@ -788,10 +790,10 @@ index cb3d494..6b348b8 100644
if (FAILED(hr = stateblock_allocate_shader_constants(stateblock)))
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index de8d6dc..db36a59 100644
index f2494b8..a8c48be 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3283,8 +3283,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
@@ -3278,8 +3278,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
enum wined3d_texture_filter_type filter)
{
struct wined3d_device *device = dst_surface->resource.device;
@ -837,7 +839,7 @@ index 4ddfead..32519eb 100644
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 720eb3a..6a10ad7 100644
index 40e806a..41b14bd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1149,6 +1149,36 @@ struct wined3d_timestamp_query
@ -915,7 +917,7 @@ index 720eb3a..6a10ad7 100644
struct wined3d_surface *onscreen_depth_stencil;
struct wined3d_rendertarget_view *auto_depth_stencil_view;
@@ -2608,9 +2632,8 @@ struct wined3d_stateblock
@@ -2606,9 +2630,8 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -927,7 +929,7 @@ index 720eb3a..6a10ad7 100644
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
struct wined3d_cs_ops
@@ -2623,7 +2646,6 @@ struct wined3d_cs
@@ -2621,7 +2644,6 @@ struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;

View File

@ -1,4 +1,4 @@
From 78e1e4771d85128087e911b9a0ad81998fb98096 Mon Sep 17 00:00:00 2001
From b8968006147a8c5708e737055655b0360643dd81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 2 Apr 2013 17:25:19 +0200
Subject: wined3d: Pass the state to draw_primitive
@ -15,7 +15,7 @@ Subject: wined3d: Pass the state to draw_primitive
8 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6fff047..4f4827f 100644
index 7adfb28..55c972b 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -423,7 +423,7 @@ static inline void fixup_d3dcolor(DWORD *dst_color)
@ -27,7 +27,7 @@ index 6fff047..4f4827f 100644
* If we want that stuff to work on big endian machines too we have to consider more things
*
* 0xff000000: Alpha mask
@@ -1190,11 +1190,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
@@ -1230,11 +1230,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE];
@ -42,10 +42,10 @@ index 6fff047..4f4827f 100644
*/
if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT])
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index c1b6e01..d9e2bc1 100644
index 474af3b..f21c81d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2992,7 +2992,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st
@@ -2999,7 +2999,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st
{
if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo)
{
@ -54,7 +54,7 @@ index c1b6e01..d9e2bc1 100644
context->use_immediate_mode_draw = TRUE;
}
else
@@ -3167,9 +3167,9 @@ static void context_bind_shader_resources(struct wined3d_context *context, const
@@ -3174,9 +3174,9 @@ static void context_bind_shader_resources(struct wined3d_context *context, const
}
/* Context activation is done by the caller. */
@ -67,7 +67,7 @@ index c1b6e01..d9e2bc1 100644
const struct wined3d_fb_state *fb = &state->fb;
unsigned int i;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 784de6e..d14fd82 100644
index 7fdfb9b..680e2bc 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -492,7 +492,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@ -80,10 +80,10 @@ index 784de6e..d14fd82 100644
return sizeof(*op);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index d7f0512..71688a5 100644
index a7329e7..1892dec 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5503,7 +5503,7 @@ static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data)
@@ -5486,7 +5486,7 @@ static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data)
}
/* Helper functions for providing vertex data to opengl. The arrays are initialized based on
@ -93,7 +93,7 @@ index d7f0512..71688a5 100644
static void WINE_GLAPI position_d3dcolor(const void *data)
{
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index af51dfd..bfbdf8c 100644
index d39bf28..b682088 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -36,7 +36,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
@ -154,8 +154,8 @@ index af51dfd..bfbdf8c 100644
const struct wined3d_stream_info *stream_info;
struct wined3d_event_query *ib_query = NULL;
struct wined3d_stream_info si_emulated;
@@ -672,7 +671,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
wined3d_surface_prepare(ds, context, location);
@@ -664,7 +663,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
}
}
- if (!context_apply_draw_state(context, device))
@ -163,7 +163,7 @@ index af51dfd..bfbdf8c 100644
{
context_release(context);
WARN("Unable to apply draw state, skipping draw.\n");
@@ -764,28 +763,28 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@@ -756,28 +755,28 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
else
WARN_(d3d_perf)("Using immediate mode with vertex shaders for half float emulation.\n");
@ -220,7 +220,7 @@ index e789786..8362ef8 100644
*/
WARN("unsupported blending in openGl\n");
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 81af9d5..64e6d6a 100644
index 32519eb..04c6dc6 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3866,7 +3866,7 @@ static void compute_texture_matrix(const struct wined3d_gl_info *gl_info, const
@ -233,7 +233,7 @@ index 81af9d5..64e6d6a 100644
default:
mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2667936..2467c22 100644
index e11e11a..076fe88 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1021,8 +1021,9 @@ struct wined3d_stream_info
@ -259,5 +259,5 @@ index 2667936..2467c22 100644
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info,
--
2.6.1
2.6.2

View File

@ -1,4 +1,4 @@
From 8842cf6a7d2b87f69462e5fe513f51bc127a8140 Mon Sep 17 00:00:00 2001
From 610e06aa206c46a868c373e485adde24638727d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 5 Apr 2013 14:37:44 +0200
Subject: wined3d: Keep track of the onscreen depth stencil in the command
@ -64,7 +64,7 @@ index d5e2c52..b20d32f 100644
{
struct wined3d_cs *cs = thread_param;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 1fef5ff..4de7eb2 100644
index 99e68d0..6360275 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -198,22 +198,6 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context
@ -90,7 +90,7 @@ index 1fef5ff..4de7eb2 100644
static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect)
{
/* partial draw rect */
@@ -348,8 +332,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@@ -343,8 +327,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
{
DWORD location = render_offscreen ? fb->depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
@ -101,7 +101,7 @@ index 1fef5ff..4de7eb2 100644
prepare_ds_clear(depth_stencil, context, location,
draw_rect, rect_count, clear_rect, &ds_rect);
}
@@ -1064,11 +1048,12 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1059,11 +1043,12 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
/* Release the buffers (with sanity checks).
* FIXME: Move this move into a separate patch. I think the idea
* behind this is that those surfaces should be freed before unloading
@ -118,7 +118,7 @@ index 1fef5ff..4de7eb2 100644
wined3d_texture_decref(surface->container);
}
@@ -4561,10 +4546,10 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4556,10 +4541,10 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
state_unbind_resources(&device->state);
}
@ -133,11 +133,11 @@ index 1fef5ff..4de7eb2 100644
if (reset_state)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 21ce53a..9ec380a 100644
index 03095e0..bfdf814 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -651,8 +651,8 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
{
@@ -647,8 +647,8 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil);
RECT current_rect, draw_rect, r;
- if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
@ -166,7 +166,7 @@ index 6ded6cc..0a8da3d 100644
}
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index dec58e5..035517f 100644
index 5e5d900..4050489 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2116,15 +2116,12 @@ struct wined3d_device
@ -195,7 +195,7 @@ index dec58e5..035517f 100644
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
@@ -2667,6 +2662,7 @@ struct wined3d_cs
@@ -2665,6 +2660,7 @@ struct wined3d_cs
struct wined3d_state state;
HANDLE thread;
DWORD tls_idx;
@ -203,7 +203,7 @@ index dec58e5..035517f 100644
size_t data_size;
void *data;
@@ -2677,6 +2673,8 @@ struct wined3d_cs
@@ -2675,6 +2671,8 @@ struct wined3d_cs
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN;
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,244 @@
From b0e2839c98b1b0f2a16b3382b1bd32fe60130700 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 10 Nov 2015 00:36:45 +0100
Subject: Revert "wined3d: Prepare GL resources before calling
context_apply_fbo_state."
This reverts commit 1ca9dfc8ee25f4ae188fdacd4d3d56046cef8003.
---
dlls/wined3d/context.c | 7 +++++++
dlls/wined3d/device.c | 13 ++++--------
dlls/wined3d/drawprim.c | 20 ++++++------------
dlls/wined3d/surface.c | 46 ++++++++++++++++--------------------------
dlls/wined3d/wined3d_private.h | 2 --
5 files changed, 34 insertions(+), 54 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 1692d0d..97f3c04 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -141,6 +141,8 @@ static void context_attach_depth_stencil_fbo(struct wined3d_context *context,
{
case WINED3D_LOCATION_TEXTURE_RGB:
case WINED3D_LOCATION_TEXTURE_SRGB:
+ wined3d_texture_prepare_texture(depth_stencil->container, context, FALSE);
+
if (format_flags & WINED3DFMT_FLAG_DEPTH)
{
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT,
@@ -159,11 +161,13 @@ static void context_attach_depth_stencil_fbo(struct wined3d_context *context,
break;
case WINED3D_LOCATION_RB_MULTISAMPLE:
+ surface_prepare_rb(depth_stencil, gl_info, TRUE);
context_attach_depth_stencil_rb(gl_info, fbo_target,
format_flags, depth_stencil->rb_multisample);
break;
case WINED3D_LOCATION_RB_RESOLVED:
+ surface_prepare_rb(depth_stencil, gl_info, FALSE);
context_attach_depth_stencil_rb(gl_info, fbo_target,
format_flags, depth_stencil->rb_resolved);
break;
@@ -213,6 +217,7 @@ static void context_attach_surface_fbo(struct wined3d_context *context,
case WINED3D_LOCATION_TEXTURE_RGB:
case WINED3D_LOCATION_TEXTURE_SRGB:
srgb = location == WINED3D_LOCATION_TEXTURE_SRGB;
+ wined3d_texture_prepare_texture(surface->container, context, srgb);
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx,
surface->texture_target, surface_get_texture_name(surface, gl_info, srgb),
surface->texture_level);
@@ -220,12 +225,14 @@ static void context_attach_surface_fbo(struct wined3d_context *context,
break;
case WINED3D_LOCATION_RB_MULTISAMPLE:
+ surface_prepare_rb(surface, gl_info, TRUE);
gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_COLOR_ATTACHMENT0 + idx,
GL_RENDERBUFFER, surface->rb_multisample);
checkGLcall("glFramebufferRenderbuffer()");
break;
case WINED3D_LOCATION_RB_RESOLVED:
+ surface_prepare_rb(surface, gl_info, FALSE);
gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_COLOR_ATTACHMENT0 + idx,
GL_RENDERBUFFER, surface->rb_resolved);
checkGLcall("glFramebufferRenderbuffer()");
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2960e08..0da8607 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -317,15 +317,13 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
* anyway. If we're not clearing the color buffer we don't have to copy either since we're not going to set
* the drawable up to date. We have to check all settings that limit the clear area though. Do not bother
* checking all this if the dest surface is in the drawable anyway. */
- for (i = 0; i < rt_count; ++i)
+ if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, clear_rect))
{
- struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]);
- if (rt && rt->resource.format->id != WINED3DFMT_NULL)
+ for (i = 0; i < rt_count; ++i)
{
- if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, clear_rect))
+ struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]);
+ if (rt)
surface_load_location(rt, context, rt->container->resource.draw_binding);
- else
- wined3d_surface_prepare(rt, context, rt->container->resource.draw_binding);
}
}
@@ -341,9 +339,6 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
drawable_height = depth_stencil->pow2Height;
}
- if (depth_stencil && render_offscreen)
- wined3d_surface_prepare(depth_stencil, context, depth_stencil->container->resource.draw_binding);
-
if (flags & WINED3DCLEAR_ZBUFFER)
{
DWORD location = render_offscreen ? fb->depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 3761830..d2d3bce 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -620,20 +620,17 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
}
gl_info = context->gl_info;
- for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
+ if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
{
- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
- if (target && target->resource.format->id != WINED3DFMT_NULL)
+ /* Invalidate the back buffer memory so LockRect will read it the next time */
+ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
- if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
+ struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
+ if (target)
{
surface_load_location(target, context, target->container->resource.draw_binding);
surface_invalidate_location(target, ~target->container->resource.draw_binding);
}
- else
- {
- wined3d_surface_prepare(target, context, target->container->resource.draw_binding);
- }
}
}
@@ -646,10 +643,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
* that we never copy the stencil data.*/
DWORD location = context->render_offscreen ? device->fb.depth_stencil->resource->draw_binding
: WINED3D_LOCATION_DRAWABLE;
- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil);
-
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
{
+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil);
RECT current_rect, draw_rect, r;
if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
@@ -665,11 +661,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
IntersectRect(&r, &draw_rect, &current_rect);
if (!EqualRect(&r, &draw_rect))
surface_load_ds_location(ds, context, location);
- else
- wined3d_surface_prepare(ds, context, location);
}
- else
- wined3d_surface_prepare(ds, context, location);
}
if (!context_apply_draw_state(context, device))
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c3ddc84..179ce02 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -821,8 +821,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
surface_load_location(src_surface, context, src_location);
if (!surface_is_full_rect(dst_surface, dst_rect))
surface_load_location(dst_surface, context, dst_location);
- else
- wined3d_surface_prepare(dst_surface, context, dst_location);
gl_info = context->gl_info;
@@ -914,9 +912,6 @@ static void surface_blt_fbo(const struct wined3d_device *device,
surface_load_location(src_surface, old_ctx, src_location);
if (!surface_is_full_rect(dst_surface, &dst_rect))
surface_load_location(dst_surface, old_ctx, dst_location);
- else
- wined3d_surface_prepare(dst_surface, old_ctx, dst_location);
-
if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
@@ -3678,7 +3673,23 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
if (surface->locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Surface was discarded, no need copy data.\n");
- wined3d_surface_prepare(surface, context, location);
+ switch (location)
+ {
+ case WINED3D_LOCATION_TEXTURE_RGB:
+ wined3d_texture_prepare_texture(surface->container, context, FALSE);
+ break;
+ case WINED3D_LOCATION_RB_MULTISAMPLE:
+ surface_prepare_rb(surface, gl_info, TRUE);
+ break;
+ case WINED3D_LOCATION_RB_RESOLVED:
+ surface_prepare_rb(surface, gl_info, FALSE);
+ break;
+ case WINED3D_LOCATION_DRAWABLE:
+ /* Nothing to do */
+ break;
+ default:
+ FIXME("Unhandled location %#x\n", location);
+ }
surface->locations &= ~WINED3D_LOCATION_DISCARDED;
surface->locations |= location;
surface->ds_current_size.cx = surface->resource.width;
@@ -5501,26 +5512,3 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
return hr;
}
-
-/* Context activation is done by the caller. */
-void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
-{
- switch (location)
- {
- case WINED3D_LOCATION_TEXTURE_RGB:
- wined3d_texture_prepare_texture(surface->container, context, FALSE);
- break;
-
- case WINED3D_LOCATION_TEXTURE_SRGB:
- wined3d_texture_prepare_texture(surface->container, context, TRUE);
- break;
-
- case WINED3D_LOCATION_RB_MULTISAMPLE:
- surface_prepare_rb(surface, context->gl_info, TRUE);
- break;
-
- case WINED3D_LOCATION_RB_RESOLVED:
- surface_prepare_rb(surface, context->gl_info, FALSE);
- break;
- }
-}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ac0b09a..49cc29f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2459,8 +2459,6 @@ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
HRESULT surface_load_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
-void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context,
- DWORD location) DECLSPEC_HIDDEN;
void surface_prepare_rb(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN;
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface,
--
2.6.2

View File

@ -0,0 +1 @@
Fixes: [39536] Revert patch to prepare GL resources before calling context_apply_fbo_state