d3d8: Implement IDirect3DIndexBuffer8 private data handling on top of wined3d_resource.
This commit is contained in:
parent
dc6581ce5e
commit
37d70103a1
|
@ -297,6 +297,11 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
static inline IDirect3DIndexBuffer8Impl *impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBuffer8 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirect3DIndexBuffer8Impl, lpVtbl);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *iface, REFIID riid, void **object)
|
||||
{
|
||||
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
||||
|
@ -371,14 +376,16 @@ static HRESULT WINAPI d3d8_indexbuffer_GetDevice(IDirect3DIndexBuffer8 *iface, I
|
|||
static HRESULT WINAPI d3d8_indexbuffer_SetPrivateData(IDirect3DIndexBuffer8 *iface,
|
||||
REFGUID guid, const void *data, DWORD data_size, DWORD flags)
|
||||
{
|
||||
IDirect3DIndexBuffer8Impl *buffer = impl_from_IDirect3DIndexBuffer8(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();
|
||||
hr = wined3d_buffer_set_private_data(((IDirect3DIndexBuffer8Impl *)iface)->wineD3DIndexBuffer,
|
||||
guid, data, data_size, flags);
|
||||
resource = wined3d_buffer_get_resource(buffer->wineD3DIndexBuffer);
|
||||
hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -387,14 +394,16 @@ static HRESULT WINAPI d3d8_indexbuffer_SetPrivateData(IDirect3DIndexBuffer8 *ifa
|
|||
static HRESULT WINAPI d3d8_indexbuffer_GetPrivateData(IDirect3DIndexBuffer8 *iface,
|
||||
REFGUID guid, void *data, DWORD *data_size)
|
||||
{
|
||||
IDirect3DIndexBuffer8Impl *buffer = impl_from_IDirect3DIndexBuffer8(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();
|
||||
hr = wined3d_buffer_get_private_data(((IDirect3DIndexBuffer8Impl *)iface)->wineD3DIndexBuffer,
|
||||
guid, data, data_size);
|
||||
resource = wined3d_buffer_get_resource(buffer->wineD3DIndexBuffer);
|
||||
hr = wined3d_resource_get_private_data(resource, guid, data, data_size);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -402,12 +411,15 @@ static HRESULT WINAPI d3d8_indexbuffer_GetPrivateData(IDirect3DIndexBuffer8 *ifa
|
|||
|
||||
static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid)
|
||||
{
|
||||
IDirect3DIndexBuffer8Impl *buffer = impl_from_IDirect3DIndexBuffer8(iface);
|
||||
struct wined3d_resource *resource;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = wined3d_buffer_free_private_data(((IDirect3DIndexBuffer8Impl *)iface)->wineD3DIndexBuffer, guid);
|
||||
resource = wined3d_buffer_get_resource(buffer->wineD3DIndexBuffer);
|
||||
hr = wined3d_resource_free_private_data(resource, guid);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -585,23 +585,6 @@ void * CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
|
|||
return buffer->resource.parent;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_buffer_set_private_data(struct wined3d_buffer *buffer,
|
||||
REFGUID guid, const void *data, DWORD data_size, DWORD flags)
|
||||
{
|
||||
return wined3d_resource_set_private_data(&buffer->resource, guid, data, data_size, flags);
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_buffer_get_private_data(const struct wined3d_buffer *buffer,
|
||||
REFGUID guid, void *data, DWORD *data_size)
|
||||
{
|
||||
return wined3d_resource_get_private_data(&buffer->resource, guid, data, data_size);
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_buffer_free_private_data(struct wined3d_buffer *buffer, REFGUID guid)
|
||||
{
|
||||
return wined3d_resource_free_private_data(&buffer->resource, guid);
|
||||
}
|
||||
|
||||
DWORD CDECL wined3d_buffer_set_priority(struct wined3d_buffer *buffer, DWORD priority)
|
||||
{
|
||||
return resource_set_priority(&buffer->resource, priority);
|
||||
|
|
|
@ -23,16 +23,13 @@
|
|||
@ cdecl wined3d_buffer_create_ib(ptr long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_buffer_create_vb(ptr long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_buffer_decref(ptr)
|
||||
@ cdecl wined3d_buffer_free_private_data(ptr ptr)
|
||||
@ cdecl wined3d_buffer_get_parent(ptr)
|
||||
@ cdecl wined3d_buffer_get_priority(ptr)
|
||||
@ cdecl wined3d_buffer_get_private_data(ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_buffer_get_resource(ptr)
|
||||
@ cdecl wined3d_buffer_incref(ptr)
|
||||
@ cdecl wined3d_buffer_map(ptr long long ptr long)
|
||||
@ cdecl wined3d_buffer_preload(ptr)
|
||||
@ cdecl wined3d_buffer_set_priority(ptr long)
|
||||
@ cdecl wined3d_buffer_set_private_data(ptr ptr ptr long long)
|
||||
@ cdecl wined3d_buffer_unmap(ptr)
|
||||
|
||||
@ cdecl wined3d_clipper_create()
|
||||
|
|
|
@ -2150,18 +2150,13 @@ HRESULT __cdecl wined3d_buffer_create_ib(struct wined3d_device *device, UINT len
|
|||
HRESULT __cdecl wined3d_buffer_create_vb(struct wined3d_device *device, UINT length, DWORD usage, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);
|
||||
ULONG __cdecl wined3d_buffer_decref(struct wined3d_buffer *buffer);
|
||||
HRESULT __cdecl wined3d_buffer_free_private_data(struct wined3d_buffer *buffer, REFGUID guid);
|
||||
void * __cdecl wined3d_buffer_get_parent(const struct wined3d_buffer *buffer);
|
||||
DWORD __cdecl wined3d_buffer_get_priority(const struct wined3d_buffer *buffer);
|
||||
HRESULT __cdecl wined3d_buffer_get_private_data(const struct wined3d_buffer *buffer,
|
||||
REFGUID guid, void *data, DWORD *data_size);
|
||||
struct wined3d_resource * __cdecl wined3d_buffer_get_resource(struct wined3d_buffer *buffer);
|
||||
ULONG __cdecl wined3d_buffer_incref(struct wined3d_buffer *buffer);
|
||||
HRESULT __cdecl wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UINT size, BYTE **data, DWORD flags);
|
||||
void __cdecl wined3d_buffer_preload(struct wined3d_buffer *buffer);
|
||||
DWORD __cdecl wined3d_buffer_set_priority(struct wined3d_buffer *buffer, DWORD new_priority);
|
||||
HRESULT __cdecl wined3d_buffer_set_private_data(struct wined3d_buffer *buffer,
|
||||
REFGUID guid, const void *data, DWORD data_size, DWORD flags);
|
||||
void __cdecl wined3d_buffer_unmap(struct wined3d_buffer *buffer);
|
||||
|
||||
struct wined3d_clipper * __cdecl wined3d_clipper_create(void);
|
||||
|
|
Loading…
Reference in New Issue