wined3d: Remove resource private data methods.

This commit is contained in:
Stefan Dösinger 2014-03-24 12:17:18 +01:00 committed by Alexandre Julliard
parent 50de4cda8f
commit ebd5f96aea
5 changed files with 3 additions and 94 deletions

View File

@ -123,52 +123,28 @@ static HRESULT WINAPI d3d9_volume_SetPrivateData(IDirect3DVolume9 *iface, REFGUI
const void *data, DWORD data_size, DWORD flags) const void *data, DWORD data_size, DWORD flags)
{ {
struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); 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", TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
iface, debugstr_guid(guid), data, data_size, flags); iface, debugstr_guid(guid), data, data_size, flags);
wined3d_mutex_lock(); return d3d9_resource_set_private_data(&volume->resource, guid, data, data_size, flags);
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;
} }
static HRESULT WINAPI d3d9_volume_GetPrivateData(IDirect3DVolume9 *iface, REFGUID guid, static HRESULT WINAPI d3d9_volume_GetPrivateData(IDirect3DVolume9 *iface, REFGUID guid,
void *data, DWORD *data_size) void *data, DWORD *data_size)
{ {
struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); 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", TRACE("iface %p, guid %s, data %p, data_size %p.\n",
iface, debugstr_guid(guid), data, data_size); iface, debugstr_guid(guid), data, data_size);
wined3d_mutex_lock(); return d3d9_resource_get_private_data(&volume->resource, guid, data, data_size);
resource = wined3d_volume_get_resource(volume->wined3d_volume);
hr = wined3d_resource_get_private_data(resource, guid, data, data_size);
wined3d_mutex_unlock();
return hr;
} }
static HRESULT WINAPI d3d9_volume_FreePrivateData(IDirect3DVolume9 *iface, REFGUID guid) static HRESULT WINAPI d3d9_volume_FreePrivateData(IDirect3DVolume9 *iface, REFGUID guid)
{ {
struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface);
struct wined3d_resource *resource;
HRESULT hr;
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
wined3d_mutex_lock(); return d3d9_resource_free_private_data(&volume->resource, guid);
resource = wined3d_volume_get_resource(volume->wined3d_volume);
hr = wined3d_resource_free_private_data(resource, guid);
wined3d_mutex_unlock();
return hr;
} }
static HRESULT WINAPI d3d9_volume_GetContainer(IDirect3DVolume9 *iface, REFIID riid, void **container) static HRESULT WINAPI d3d9_volume_GetContainer(IDirect3DVolume9 *iface, REFIID riid, void **container)

View File

@ -100,7 +100,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource->parent = parent; resource->parent = parent;
resource->parent_ops = parent_ops; resource->parent_ops = parent_ops;
resource->resource_ops = resource_ops; resource->resource_ops = resource_ops;
wined3d_private_store_init(&resource->private_store);
if (size) if (size)
{ {
@ -144,8 +143,6 @@ void resource_cleanup(struct wined3d_resource *resource)
adapter_adjust_memory(resource->device->adapter, 0 - resource->size); adapter_adjust_memory(resource->device->adapter, 0 - resource->size);
} }
wined3d_private_store_cleanup(&resource->private_store);
wined3d_resource_free_sysmem(resource); wined3d_resource_free_sysmem(resource);
device_resource_released(resource->device, resource); device_resource_released(resource->device, resource);
@ -160,61 +157,6 @@ void resource_unload(struct wined3d_resource *resource)
resource, resource->type); 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 resource_set_priority(struct wined3d_resource *resource, DWORD priority)
{ {
DWORD prev = resource->priority; DWORD prev = resource->priority;

View File

@ -170,12 +170,9 @@
@ cdecl wined3d_query_incref(ptr) @ cdecl wined3d_query_incref(ptr)
@ cdecl wined3d_query_issue(ptr long) @ 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_desc(ptr ptr)
@ cdecl wined3d_resource_get_parent(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_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_create(ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_decref(ptr) @ cdecl wined3d_rendertarget_view_decref(ptr)

View File

@ -2008,7 +2008,6 @@ struct wined3d_resource
DWORD priority; DWORD priority;
void *heap_memory; void *heap_memory;
struct list resource_list_entry; struct list resource_list_entry;
struct wined3d_private_store private_store;
void *parent; void *parent;
const struct wined3d_parent_ops *parent_ops; const struct wined3d_parent_ops *parent_ops;

View File

@ -2340,15 +2340,10 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv
return WINED3D_OK; 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, void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
struct wined3d_resource_desc *desc); struct wined3d_resource_desc *desc);
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource); 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); 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, HRESULT __cdecl wined3d_rendertarget_view_create(struct wined3d_resource *resource,
void *parent, struct wined3d_rendertarget_view **rendertarget_view); void *parent, struct wined3d_rendertarget_view **rendertarget_view);