Module: wine
Branch: master
Commit: 2d5c8aff3ccbbdcf3a8c9d6e3262d894684d1a9c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2d5c8aff3ccbbdcf3a8c9d6e3…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Mon Sep 29 09:11:55 2014 +0200
wined3d: Get rid of SFLAG_DONOTFREE.
---
dlls/wined3d/surface.c | 7 ++++++-
dlls/wined3d/wined3d_private.h | 10 ----------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index add864a..955c1b6 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -587,7 +587,12 @@ void surface_prepare_map_memory(struct wined3d_surface *surface)
static void surface_evict_sysmem(struct wined3d_surface *surface)
{
- if (surface->resource.map_count || surface->flags & SFLAG_DONOTFREE)
+ /* In some conditions the surface memory must not be freed:
+ * SFLAG_CONVERTED: Converting the data back would take too long
+ * SFLAG_DYNLOCK: Avoid freeing the data for performance
+ * SFLAG_CLIENT: OpenGL uses our memory as backup */
+ if (surface->resource.map_count || surface->flags & (SFLAG_CONVERTED | SFLAG_DYNLOCK
+ | SFLAG_CLIENT | SFLAG_PIN_SYSMEM))
return;
wined3d_resource_free_sysmem(&surface->resource);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 76ac66a..110334b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2350,16 +2350,6 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#define SFLAG_ALLOCATED 0x00000800 /* A GL texture is allocated for this surface. */
#define SFLAG_SRGBALLOCATED 0x00001000 /* A sRGB GL texture is allocated for this surface. */
-/* In some conditions the surface memory must not be freed:
- * SFLAG_CONVERTED: Converting the data back would take too long
- * SFLAG_DYNLOCK: Avoid freeing the data for performance
- * SFLAG_CLIENT: OpenGL uses our memory as backup
- */
-#define SFLAG_DONOTFREE (SFLAG_CONVERTED | \
- SFLAG_DYNLOCK | \
- SFLAG_CLIENT | \
- SFLAG_PIN_SYSMEM)
-
enum wined3d_conversion_type
{
WINED3D_CT_NONE,
Module: wine
Branch: master
Commit: d5365aae28255c8cc55f12d39cc7fec8428a8889
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d5365aae28255c8cc55f12d39…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Mon Sep 29 09:11:51 2014 +0200
d3d8: Get rid of the format switching code in d3d8_device_CopyRects().
This can't possibly do anything, since we fail texture creation for
WINED3DFMT_UNKNOWN. If texture creation with D3DFMT_UNKNOWN is actually
supposed to work, we should probably pick an appropriate format at creation,
instead of during CopyRects(). This code has existed in some form or another
since the initial version in commit 850a9429dbc07c0b38e9f9f60aaec43759326d24.
No tests, of course.
---
dlls/d3d8/device.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 8ddb0cb..dd0b9ee 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -988,7 +988,6 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface,
struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
UINT src_w, src_h;
- HRESULT hr;
TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
iface, src_surface, src_rects, rect_count, dst_surface, dst_points);
@@ -1020,24 +1019,13 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface,
dst_format = wined3d_desc.format;
/* Check that the source and destination formats match */
- if (src_format != dst_format && WINED3DFMT_UNKNOWN != dst_format)
+ if (src_format != dst_format)
{
WARN("Source %p format must match the destination %p format, returning D3DERR_INVALIDCALL.\n",
src_surface, dst_surface);
wined3d_mutex_unlock();
return D3DERR_INVALIDCALL;
}
- else if (WINED3DFMT_UNKNOWN == dst_format)
- {
- TRACE("Converting destination surface from WINED3DFMT_UNKNOWN to the source format.\n");
- if (FAILED(hr = wined3d_surface_update_desc(dst->wined3d_surface, wined3d_desc.width, wined3d_desc.height,
- src_format, wined3d_desc.multisample_type, wined3d_desc.multisample_quality, NULL, 0)))
- {
- WARN("Failed to update surface desc, hr %#x.\n", hr);
- wined3d_mutex_unlock();
- return hr;
- }
- }
/* Quick if complete copy ... */
if (!rect_count && !src_rects && !dst_points)