Commit 06255e69 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ddraw: Do not require specific texture location for blits.

parent 2f938ef3
......@@ -699,6 +699,15 @@ static inline struct wined3d_texture *ddraw_surface_get_draw_texture(struct ddra
return surface->draw_texture;
}
static inline struct wined3d_texture *ddraw_surface_get_any_texture(struct ddraw_surface *surface, unsigned int flags)
{
if (surface->texture_location & DDRAW_SURFACE_LOCATION_DEFAULT)
return ddraw_surface_get_default_texture(surface, flags);
assert(surface->texture_location & DDRAW_SURFACE_LOCATION_DRAW);
return ddraw_surface_get_draw_texture(surface, flags);
}
void d3d_device_sync_surfaces(struct d3d_device *device) DECLSPEC_HIDDEN;
/* Used for generic dumping */
......
......@@ -6171,9 +6171,9 @@ static void copy_mipmap_chain(struct d3d_device *device, struct ddraw_surface *d
UINT src_h = src_rect.bottom - src_rect.top;
RECT dst_rect = {point.x, point.y, point.x + src_w, point.y + src_h};
if (FAILED(hr = wined3d_texture_blt(ddraw_surface_get_default_texture(dst_level, DDRAW_SURFACE_RW),
if (FAILED(hr = wined3d_texture_blt(ddraw_surface_get_any_texture(dst_level, DDRAW_SURFACE_RW),
dst_level->sub_resource_idx, &dst_rect,
ddraw_surface_get_default_texture(src_level, DDRAW_SURFACE_READ),
ddraw_surface_get_any_texture(src_level, DDRAW_SURFACE_READ),
src_level->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
ERR("Blit failed, hr %#x.\n", hr);
......
......@@ -113,7 +113,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface,
dst_texture = ddraw->wined3d_frontbuffer;
if (SUCCEEDED(hr = wined3d_texture_blt(dst_texture, 0, rect,
ddraw_surface_get_default_texture(surface, DDRAW_SURFACE_READ), surface->sub_resource_idx, rect, 0,
ddraw_surface_get_any_texture(surface, DDRAW_SURFACE_READ), surface->sub_resource_idx, rect, 0,
NULL, WINED3D_TEXF_POINT)) && swap_interval)
{
hr = wined3d_swapchain_present(ddraw->wined3d_swapchain, rect, rect, NULL, swap_interval, 0);
......@@ -1557,8 +1557,8 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT *
if (!(flags & DDBLT_ASYNC))
wined3d_flags |= WINED3D_BLT_SYNCHRONOUS;
return wined3d_texture_blt(ddraw_surface_get_default_texture(dst_surface, DDRAW_SURFACE_RW),
dst_surface->sub_resource_idx, dst_rect, ddraw_surface_get_default_texture(src_surface, DDRAW_SURFACE_READ),
return wined3d_texture_blt(ddraw_surface_get_any_texture(dst_surface, DDRAW_SURFACE_RW),
dst_surface->sub_resource_idx, dst_rect, ddraw_surface_get_any_texture(src_surface, DDRAW_SURFACE_READ),
src_surface->sub_resource_idx, src_rect, wined3d_flags, fx, filter);
}
......@@ -4406,8 +4406,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_BltFast(IDirectDrawSurfac
if (src_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
hr = ddraw_surface_update_frontbuffer(src_impl, src_rect, TRUE, 0);
if (SUCCEEDED(hr))
hr = wined3d_texture_blt(ddraw_surface_get_default_texture(dst_impl, DDRAW_SURFACE_RW),
dst_impl->sub_resource_idx, &dst_rect, ddraw_surface_get_default_texture(src_impl,DDRAW_SURFACE_READ),
hr = wined3d_texture_blt(ddraw_surface_get_any_texture(dst_impl, DDRAW_SURFACE_RW),
dst_impl->sub_resource_idx, &dst_rect, ddraw_surface_get_any_texture(src_impl,DDRAW_SURFACE_READ),
src_impl->sub_resource_idx, src_rect, flags, NULL, WINED3D_TEXF_POINT);
if (SUCCEEDED(hr) && (dst_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
hr = ddraw_surface_update_frontbuffer(dst_impl, &dst_rect, FALSE, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment