return DDERR_OUTOFVIDEOMEMORY;
}
- ddraw_surface_init(ddraw_surface, ddraw, wined3d_texture, surface, parent_ops);
+ ddraw_surface_init(ddraw_surface, ddraw, wined3d_texture, sub_resource_idx, surface, parent_ops);
*parent = ddraw_surface;
ddraw_update_lost_surfaces(ddraw);
struct ddraw *ddraw;
struct wined3d_surface *wined3d_surface;
struct wined3d_texture *wined3d_texture;
+ unsigned int sub_resource_idx;
struct wined3d_rendertarget_view *wined3d_rtv;
struct wined3d_private_store private_store;
struct d3d_device *device1;
HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc,
struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN;
struct wined3d_rendertarget_view *ddraw_surface_get_rendertarget_view(struct ddraw_surface *surface) DECLSPEC_HIDDEN;
-void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct wined3d_texture *wined3d_texture,
+void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
+ struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx,
struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN;
ULONG ddraw_surface_release_iface(struct ddraw_surface *This) DECLSPEC_HIDDEN;
HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface,
if (src_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
hr = ddraw_surface_update_frontbuffer(src_impl, src_rect, TRUE);
if (SUCCEEDED(hr))
- hr = wined3d_surface_blt(dst_impl->wined3d_surface, &dst_rect,
- src_impl->wined3d_surface, src_rect, flags, NULL, WINED3D_TEXF_POINT);
+ hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &dst_rect,
+ src_impl->wined3d_texture, 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);
wined3d_mutex_unlock();
return hr;
}
-void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct wined3d_texture *wined3d_texture,
+void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
+ struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx,
struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops)
{
struct ddraw_texture *texture = wined3d_texture_get_parent(wined3d_texture);
surface->wined3d_surface = wined3d_surface;
wined3d_texture_incref(surface->wined3d_texture = wined3d_texture);
+ surface->sub_resource_idx = sub_resource_idx;
*parent_ops = &ddraw_surface_wined3d_parent_ops;
wined3d_private_store_init(&surface->private_store);