@@ -1,4 +1,4 @@
From 03998dcf5391b8b5da7b8cecbfe2ac6b82c77502 Mon Sep 17 00:00:00 2001
From 17d147ac91bdf126f87fea0e4da5365fba35dd63 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,10 +9,10 @@ Subject: wined3d: Remove surface_invalidate_location.
dlls/wined3d/device.c | 4 ++--
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 43 ++++++++++++++++-----------------------
dlls/wined3d/swapchain.c | 6 +++---
dlls/wined3d/swapchain.c | 10 ++++-- ---
dlls/wined3d/texture.c | 10 ++++-----
dlls/wined3d/wined3d_private.h | 1 -
8 files changed, 29 insertions(+), 41 deletions(-)
8 files changed, 31 insertions(+), 43 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 60d2560..eb09795 100644
@@ -28,10 +28,10 @@ index 60d2560..eb09795 100644
static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view,
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 490c20f..9408cd9 100644
index d0deff9..6ff5f4a 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3322 ,7 +3322 ,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
@@ -3443 ,7 +3443 ,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,7 +41,7 @@ index 490c20f..9408cd9 100644
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3cfff6e..1f061fd 100644
index d4c0009..300a903 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -399,7 +399,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@@ -53,7 +53,7 @@ index 3cfff6e..1f061fd 100644
}
}
@@ -4140 ,7 +4140 ,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4115 ,7 +4115 ,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);
@@ -76,10 +76,10 @@ index 75489db..9ba6ef7 100644
else
{
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c4b9cac..b292adc 100644
index 9712d63..babc5fd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -597 ,7 +597 ,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
@@ -585 ,7 +585 ,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
return;
wined3d_resource_free_sysmem(&surface->resource);
@@ -88,7 +88,7 @@ index c4b9cac..b292adc 100644
}
static BOOL surface_use_pbo(const struct wined3d_surface *surface)
@@ -1111 ,7 +1111 ,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
@@ -1093 ,7 +1093 ,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 c4b9cac..b292adc 100644
}
static ULONG surface_resource_incref(struct wined3d_resource *resource)
@@ -1159 ,21 +1159 ,21 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1141 ,21 +1141 ,21 @@ static void surface_unload(struct wined3d_resource *resource)
if (resource->usage & WINED3DUSAGE_DEPTHSTENCIL)
{
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED);
@@ -122,7 +122,7 @@ index c4b9cac..b292adc 100644
}
/* Destroy PBOs, but load them into real sysmem before */
@@ -1224 ,7 +1224 ,10 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso
@@ -1209 ,7 +1209 ,10 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso
static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location)
{
@@ -134,7 +134,7 @@ index c4b9cac..b292adc 100644
}
static const struct wined3d_resource_ops surface_resource_ops =
@@ -1708 ,7 +1711 ,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1693 ,7 +1696 ,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);
@@ -143,7 +143,7 @@ index c4b9cac..b292adc 100644
return WINED3D_OK;
}
@@ -2677 ,7 +2680 ,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
@@ -2526 ,7 +2529 ,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
@@ -152,7 +152,7 @@ index c4b9cac..b292adc 100644
switch (surface->resource.map_binding)
{
@@ -3069 ,7 +3072 ,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
@@ -2924 ,7 +2927 ,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);
@@ -161,7 +161,7 @@ index c4b9cac..b292adc 100644
}
/* Uses the hardware to stretch and flip the image */
@@ -3137 ,7 +3140 ,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -2992 ,7 +2995 ,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 */
@@ -170,7 +170,7 @@ index c4b9cac..b292adc 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3342 ,7 +3345 ,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3197 ,7 +3200 ,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);
@@ -179,7 +179,7 @@ index c4b9cac..b292adc 100644
}
/* Front buffer coordinates are always full screen coordinates, but our GL
@@ -3836 ,18 +3839 ,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3691 ,18 +3694 ,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
@@ -198,7 +198,7 @@ index c4b9cac..b292adc 100644
static DWORD resource_access_from_location(DWORD location)
{
switch (location)
@@ -4395 ,7 +4386 ,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl
@@ -4250 ,7 +4241 ,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl
(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);
@@ -207,7 +207,7 @@ index c4b9cac..b292adc 100644
}
const struct blit_shader ffp_blit = {
@@ -5373 ,7 +5364 ,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -5204 ,7 +5195 ,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
@@ -216,7 +216,7 @@ index c4b9cac..b292adc 100644
return WINED3D_OK;
}
@@ -5492 ,7 +5483 ,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
@@ -5323 ,7 +5314 ,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);
@@ -226,10 +226,28 @@ index c4b9cac..b292adc 100644
return hr;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index a97d1f7..a054c05 100644
index 8ee0f82..dae2aa5 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -526,7 +526,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
@@ -453,7 +453,7 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
surface_prev->rb_multisample = surface->rb_multisample;
wined3d_resource_validate_location(&surface_prev->resource, surface->resource.locations & supported_locations);
- surface_invalidate_location(surface_prev, ~(surface->resource.locations & supported_locations));
+ wined3d_resource_invalidate_location(&surface_prev->resource, ~(surface->resource.locations & supported_locations));
surface_prev = surface;
}
@@ -462,7 +462,7 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
surface_prev->rb_multisample = rb0;
wined3d_resource_validate_location(&surface_prev->resource, locations0 & supported_locations);
- surface_invalidate_location(surface_prev, ~(locations0 & supported_locations));
+ wined3d_resource_invalidate_location(&surface_prev->resource, ~(locations0 & supported_locations));
device_invalidate_state(swapchain->device, STATE_FRAMEBUFFER);
}
@@ -571,7 +571,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB);
@@ -238,7 +256,7 @@ index a97d1f7..a054c05 100644
swapchain->render_to_fbo = TRUE;
swapchain_update_draw_bindings(swapchain);
}
@@ -571 ,7 +571 ,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
@@ -618 ,7 +618 ,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));
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
@@ -247,7 +265,7 @@ index a97d1f7..a054c05 100644
/* 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.
@@ -844 ,7 +844 ,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
@@ -891 ,7 +891 ,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);
@@ -257,10 +275,10 @@ index a97d1f7..a054c05 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 535159a..da1bbbb 100644
index 373c906..9b5bd1b 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
@@ -816 ,7 +816 ,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);
@@ -269,7 +287,7 @@ index 535159a..da1bbbb 100644
}
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
@@ -788 ,9 +788 ,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
@@ -828 ,9 +828 ,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)
{
@@ -280,7 +298,7 @@ index 535159a..da1bbbb 100644
}
static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location)
@@ -1560 ,7 +1558 ,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
@@ -1698 ,7 +1696 ,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
}
surface_load_location(surface, context, WINED3D_LOCATION_DIB);
@@ -289,7 +307,7 @@ index 535159a..da1bbbb 100644
if (context)
context_release(context);
@@ -1623 ,7 +1621 ,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
@@ -1761 ,7 +1759 ,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
context = context_acquire(device, NULL);
surface_load_location(surface, context, surface->resource.map_binding);
@@ -299,10 +317,10 @@ index 535159a..da1bbbb 100644
context_release(context);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index dc24c36..428eadd 100644
index 0039805..36a82f8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2544 ,7 +2544 ,6 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface) DECLSPEC_HID
@@ -2572 ,7 +2572 ,6 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface) DECLSPEC_HID
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
@@ -311,5 +329,5 @@ index dc24c36..428eadd 100644
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
- -
2.7.0
2.7.1