mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 02:23:38 +00:00
wined3d: Pass parent ops to wined3d_texture_set_sub_resource_parent().
So that we can allow setting the sub resource and parent ops not from the texture_sub_resource_created() callback, and also that we can "detach" a wined3d surface from ddraw after creating it, so that we can recreate the backing wined3d texture, viz. in SetSurfaceDesc().
This commit is contained in:
parent
f103da7c69
commit
4f8635bd78
|
@ -29,6 +29,8 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
|
|||
static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface2(IDirectDrawSurface2 *iface);
|
||||
static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface);
|
||||
|
||||
static const struct wined3d_parent_ops ddraw_surface_wined3d_parent_ops;
|
||||
|
||||
static inline struct ddraw_surface *impl_from_IDirectDrawGammaControl(IDirectDrawGammaControl *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawGammaControl_iface);
|
||||
|
@ -1343,9 +1345,16 @@ static void ddraw_texture_rename_to(struct ddraw_texture *dst_texture, struct wi
|
|||
if (dst_surface->sub_resource_idx)
|
||||
ERR("Invalid sub-resource index %u for surface %p.\n", dst_surface->sub_resource_idx, dst_surface);
|
||||
|
||||
wined3d_texture_set_sub_resource_parent(wined3d_texture, 0, dst_surface);
|
||||
if (draw_texture)
|
||||
wined3d_texture_set_sub_resource_parent(draw_texture, 0, dst_surface);
|
||||
{
|
||||
wined3d_texture_set_sub_resource_parent(draw_texture, 0, dst_surface, &ddraw_surface_wined3d_parent_ops);
|
||||
wined3d_texture_set_sub_resource_parent(wined3d_texture, 0, dst_surface, &ddraw_null_wined3d_parent_ops);
|
||||
}
|
||||
else
|
||||
{
|
||||
wined3d_texture_set_sub_resource_parent(wined3d_texture, 0, dst_surface, &ddraw_surface_wined3d_parent_ops);
|
||||
}
|
||||
|
||||
wined3d_resource_set_parent(wined3d_texture_get_resource(wined3d_texture), dst_texture);
|
||||
if (draw_texture)
|
||||
wined3d_resource_set_parent(wined3d_texture_get_resource(draw_texture), dst_texture);
|
||||
|
@ -6132,7 +6141,7 @@ static HRESULT ddraw_texture_init(struct ddraw_texture *texture, struct ddraw *d
|
|||
assert(parent->wined3d_texture == draw_texture);
|
||||
parent->draw_texture = draw_texture;
|
||||
parent->wined3d_texture = wined3d_texture;
|
||||
wined3d_texture_set_sub_resource_parent(wined3d_texture, i, parent);
|
||||
wined3d_texture_set_sub_resource_parent(wined3d_texture, i, parent, &ddraw_null_wined3d_parent_ops);
|
||||
wined3d_texture_incref(wined3d_texture);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4329,7 +4329,7 @@ void * CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *tex
|
|||
}
|
||||
|
||||
void CDECL wined3d_texture_set_sub_resource_parent(struct wined3d_texture *texture,
|
||||
unsigned int sub_resource_idx, void *parent)
|
||||
unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
TRACE("texture %p, sub_resource_idx %u, parent %p.\n", texture, sub_resource_idx, parent);
|
||||
|
||||
|
@ -4337,6 +4337,7 @@ void CDECL wined3d_texture_set_sub_resource_parent(struct wined3d_texture *textu
|
|||
return;
|
||||
|
||||
texture->sub_resources[sub_resource_idx].parent = parent;
|
||||
texture->sub_resources[sub_resource_idx].parent_ops = parent_ops;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture,
|
||||
|
|
|
@ -307,7 +307,7 @@
|
|||
@ cdecl wined3d_texture_set_color_key(ptr long ptr)
|
||||
@ cdecl wined3d_texture_set_lod(ptr long)
|
||||
@ cdecl wined3d_texture_set_overlay_position(ptr long long long)
|
||||
@ cdecl wined3d_texture_set_sub_resource_parent(ptr long ptr)
|
||||
@ cdecl wined3d_texture_set_sub_resource_parent(ptr long ptr ptr)
|
||||
@ cdecl wined3d_texture_update_desc(ptr long long long long long long ptr long)
|
||||
@ cdecl wined3d_texture_update_overlay(ptr long ptr ptr long ptr long)
|
||||
|
||||
|
|
|
@ -2866,7 +2866,7 @@ unsigned int __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, un
|
|||
HRESULT __cdecl wined3d_texture_set_overlay_position(struct wined3d_texture *texture,
|
||||
unsigned int sub_resource_idx, LONG x, LONG y);
|
||||
void __cdecl wined3d_texture_set_sub_resource_parent(struct wined3d_texture *texture,
|
||||
unsigned int sub_resource_idx, void *parent);
|
||||
unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops);
|
||||
HRESULT __cdecl wined3d_texture_update_desc(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
UINT width, UINT height, enum wined3d_format_id format_id,
|
||||
enum wined3d_multisample_type multisample_type, UINT multisample_quality,
|
||||
|
|
Loading…
Reference in a new issue