Commit ebd5f96a authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Remove resource private data methods.

parent 50de4cda
......@@ -123,52 +123,28 @@ static HRESULT WINAPI d3d9_volume_SetPrivateData(IDirect3DVolume9 *iface, REFGUI
const void *data, DWORD data_size, DWORD flags)
{
struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface);
struct wined3d_resource *resource;
HRESULT hr;
TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
iface, debugstr_guid(guid), data, data_size, flags);
wined3d_mutex_lock();
resource = wined3d_volume_get_resource(volume->wined3d_volume);
hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags);
wined3d_mutex_unlock();
return hr;
return d3d9_resource_set_private_data(&volume->resource, guid, data, data_size, flags);
}
static HRESULT WINAPI d3d9_volume_GetPrivateData(IDirect3DVolume9 *iface, REFGUID guid,
void *data, DWORD *data_size)
{
struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface);
struct wined3d_resource *resource;
HRESULT hr;
TRACE("iface %p, guid %s, data %p, data_size %p.\n",
iface, debugstr_guid(guid), data, data_size);
wined3d_mutex_lock();
resource = wined3d_volume_get_resource(volume->wined3d_volume);
hr = wined3d_resource_get_private_data(resource, guid, data, data_size);
wined3d_mutex_unlock();
return hr;
return d3d9_resource_get_private_data(&volume->resource, guid, data, data_size);
}
static HRESULT WINAPI d3d9_volume_FreePrivateData(IDirect3DVolume9 *iface, REFGUID guid)
{
struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface);
struct wined3d_resource *resource;
HRESULT hr;
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
wined3d_mutex_lock();
resource = wined3d_volume_get_resource(volume->wined3d_volume);
hr = wined3d_resource_free_private_data(resource, guid);
wined3d_mutex_unlock();
return hr;
return d3d9_resource_free_private_data(&volume->resource, guid);
}
static HRESULT WINAPI d3d9_volume_GetContainer(IDirect3DVolume9 *iface, REFIID riid, void **container)
......
......@@ -100,7 +100,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource->parent = parent;
resource->parent_ops = parent_ops;
resource->resource_ops = resource_ops;
wined3d_private_store_init(&resource->private_store);
if (size)
{
......@@ -144,8 +143,6 @@ void resource_cleanup(struct wined3d_resource *resource)
adapter_adjust_memory(resource->device->adapter, 0 - resource->size);
}
wined3d_private_store_cleanup(&resource->private_store);
wined3d_resource_free_sysmem(resource);
device_resource_released(resource->device, resource);
......@@ -160,61 +157,6 @@ void resource_unload(struct wined3d_resource *resource)
resource, resource->type);
}
HRESULT CDECL wined3d_resource_set_private_data(struct wined3d_resource *resource, REFGUID guid,
const void *data, DWORD data_size, DWORD flags)
{
TRACE("resource %p, riid %s, data %p, data_size %u, flags %#x.\n",
resource, debugstr_guid(guid), data, data_size, flags);
return wined3d_private_store_set_private_data(&resource->private_store, guid, data, data_size, flags);
}
HRESULT CDECL wined3d_resource_get_private_data(const struct wined3d_resource *resource, REFGUID guid,
void *data, DWORD *data_size)
{
const struct wined3d_private_data *d;
DWORD size_in;
TRACE("resource %p, guid %s, data %p, data_size %p.\n",
resource, debugstr_guid(guid), data, data_size);
d = wined3d_private_store_get_private_data(&resource->private_store, guid);
if (!d)
return WINED3DERR_NOTFOUND;
size_in = *data_size;
*data_size = d->size;
if (!data)
return WINED3D_OK;
if (size_in < d->size)
return WINED3DERR_MOREDATA;
if (d->flags & WINED3DSPD_IUNKNOWN)
{
*(IUnknown **)data = d->content.object;
IUnknown_AddRef(d->content.object);
}
else
{
memcpy(data, d->content.data, d->size);
}
return WINED3D_OK;
}
HRESULT CDECL wined3d_resource_free_private_data(struct wined3d_resource *resource, REFGUID guid)
{
struct wined3d_private_data *entry;
TRACE("resource %p, guid %s.\n", resource, debugstr_guid(guid));
entry = wined3d_private_store_get_private_data(&resource->private_store, guid);
if (!entry)
return WINED3DERR_NOTFOUND;
wined3d_private_store_free_private_data(&resource->private_store, entry);
return WINED3D_OK;
}
DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority)
{
DWORD prev = resource->priority;
......
......@@ -170,12 +170,9 @@
@ cdecl wined3d_query_incref(ptr)
@ cdecl wined3d_query_issue(ptr long)
@ cdecl wined3d_resource_free_private_data(ptr ptr)
@ cdecl wined3d_resource_get_desc(ptr ptr)
@ cdecl wined3d_resource_get_parent(ptr)
@ cdecl wined3d_resource_get_private_data(ptr ptr ptr ptr)
@ cdecl wined3d_resource_set_parent(ptr ptr)
@ cdecl wined3d_resource_set_private_data(ptr ptr ptr long long)
@ cdecl wined3d_rendertarget_view_create(ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_decref(ptr)
......
......@@ -2008,7 +2008,6 @@ struct wined3d_resource
DWORD priority;
void *heap_memory;
struct list resource_list_entry;
struct wined3d_private_store private_store;
void *parent;
const struct wined3d_parent_ops *parent_ops;
......
......@@ -2340,15 +2340,10 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv
return WINED3D_OK;
}
HRESULT __cdecl wined3d_resource_free_private_data(struct wined3d_resource *resource, REFGUID guid);
void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
struct wined3d_resource_desc *desc);
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
HRESULT __cdecl wined3d_resource_get_private_data(const struct wined3d_resource *resource,
REFGUID guid, void *data, DWORD *data_size);
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent);
HRESULT __cdecl wined3d_resource_set_private_data(struct wined3d_resource *resource,
REFGUID guid, const void *data, DWORD data_size, DWORD flags);
HRESULT __cdecl wined3d_rendertarget_view_create(struct wined3d_resource *resource,
void *parent, struct wined3d_rendertarget_view **rendertarget_view);
......
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