mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 02:03:37 +00:00
wined3d: Pass parent ops to wined3d_resource_set_parent().
So that we can "detach" a wined3d surface from ddraw after creating it, in turn so that we can recreate the backing wined3d texture for a surface, namely for SetSurfaceDesc().
This commit is contained in:
parent
4f8635bd78
commit
a18bc5f9d7
|
@ -30,6 +30,7 @@ static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface2(IDirectDrawSur
|
|||
static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface);
|
||||
|
||||
static const struct wined3d_parent_ops ddraw_surface_wined3d_parent_ops;
|
||||
static const struct wined3d_parent_ops ddraw_texture_wined3d_parent_ops;
|
||||
|
||||
static inline struct ddraw_surface *impl_from_IDirectDrawGammaControl(IDirectDrawGammaControl *iface)
|
||||
{
|
||||
|
@ -1349,15 +1350,18 @@ static void ddraw_texture_rename_to(struct ddraw_texture *dst_texture, struct wi
|
|||
{
|
||||
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);
|
||||
wined3d_resource_set_parent(wined3d_texture_get_resource(draw_texture),
|
||||
dst_texture, &ddraw_texture_wined3d_parent_ops);
|
||||
wined3d_resource_set_parent(wined3d_texture_get_resource(wined3d_texture),
|
||||
dst_texture, &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, &ddraw_texture_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);
|
||||
dst_surface->wined3d_texture = wined3d_texture;
|
||||
dst_surface->draw_texture = draw_texture;
|
||||
|
||||
|
@ -6134,7 +6138,9 @@ static HRESULT ddraw_texture_init(struct ddraw_texture *texture, struct ddraw *d
|
|||
NULL, &ddraw_null_wined3d_parent_ops, &wined3d_texture)))
|
||||
goto fail;
|
||||
|
||||
wined3d_resource_set_parent(wined3d_texture_get_resource(wined3d_texture), texture);
|
||||
wined3d_resource_set_parent(wined3d_texture_get_resource(wined3d_texture),
|
||||
texture, &ddraw_null_wined3d_parent_ops);
|
||||
|
||||
for (i = 0; i < layers * levels; ++i)
|
||||
{
|
||||
parent = wined3d_texture_get_sub_resource_parent(draw_texture, i);
|
||||
|
|
|
@ -292,9 +292,10 @@ void * CDECL wined3d_resource_get_parent(const struct wined3d_resource *resource
|
|||
return resource->parent;
|
||||
}
|
||||
|
||||
void CDECL wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent)
|
||||
void CDECL wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
resource->parent = parent;
|
||||
resource->parent_ops = parent_ops;
|
||||
}
|
||||
|
||||
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
|
||||
|
|
|
@ -195,7 +195,7 @@
|
|||
@ cdecl wined3d_resource_get_priority(ptr)
|
||||
@ cdecl wined3d_resource_map(ptr long ptr ptr long)
|
||||
@ cdecl wined3d_resource_preload(ptr)
|
||||
@ cdecl wined3d_resource_set_parent(ptr ptr)
|
||||
@ cdecl wined3d_resource_set_parent(ptr ptr ptr)
|
||||
@ cdecl wined3d_resource_set_priority(ptr long)
|
||||
@ cdecl wined3d_resource_unmap(ptr long)
|
||||
|
||||
|
|
|
@ -2679,7 +2679,8 @@ unsigned int __cdecl wined3d_resource_get_priority(const struct wined3d_resource
|
|||
HRESULT __cdecl wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, uint32_t flags);
|
||||
void __cdecl wined3d_resource_preload(struct wined3d_resource *resource);
|
||||
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent);
|
||||
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops);
|
||||
unsigned int __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, unsigned int priority);
|
||||
HRESULT __cdecl wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx);
|
||||
|
||||
|
|
Loading…
Reference in a new issue