d3d9: Don't use a wined3d_volume in d3d9_volume_GetDesc.

finally removed the wind3d_volume pointer from d3d9_volume.
Also removed wined3d_volume_get_resource.

Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Riccardo Bortolato 2015-10-07 19:04:33 +02:00 committed by Alexandre Julliard
parent 8dd86823fd
commit fca636a01c
6 changed files with 6 additions and 19 deletions

View File

@ -193,12 +193,11 @@ struct d3d9_volume
struct d3d9_resource resource;
struct wined3d_texture *wined3d_texture;
unsigned int sub_resource_idx;
struct wined3d_volume *wined3d_volume;
struct d3d9_texture *texture;
};
void volume_init(struct d3d9_volume *volume, struct wined3d_texture *wined3d_texture,
unsigned int sub_resource_idx, struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN;
unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN;
struct d3d9_swapchain
{

View File

@ -3564,7 +3564,7 @@ static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *
if (!(d3d_volume = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_volume))))
return E_OUTOFMEMORY;
volume_init(d3d_volume, wined3d_texture, sub_resource_idx, volume, parent_ops);
volume_init(d3d_volume, wined3d_texture, sub_resource_idx, parent_ops);
*parent = d3d_volume;
TRACE("Created volume %p.\n", d3d_volume);

View File

@ -117,13 +117,13 @@ static HRESULT WINAPI d3d9_volume_GetDesc(IDirect3DVolume9 *iface, D3DVOLUME_DES
{
struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface);
struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
struct wined3d_resource *sub_resource;
TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock();
wined3d_resource = wined3d_volume_get_resource(volume->wined3d_volume);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
sub_resource = wined3d_texture_get_sub_resource(volume->wined3d_texture, volume->sub_resource_idx);
wined3d_resource_get_desc(sub_resource, &wined3d_desc);
wined3d_mutex_unlock();
desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
@ -203,12 +203,11 @@ static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops =
};
void volume_init(struct d3d9_volume *volume, struct wined3d_texture *wined3d_texture,
unsigned int sub_resource_idx, struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops)
unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops)
{
volume->IDirect3DVolume9_iface.lpVtbl = &d3d9_volume_vtbl;
d3d9_resource_init(&volume->resource);
volume->resource.refcount = 0;
volume->wined3d_volume = wined3d_volume;
volume->texture = wined3d_texture_get_parent(wined3d_texture);
volume->wined3d_texture = wined3d_texture;
volume->sub_resource_idx = sub_resource_idx;

View File

@ -474,13 +474,6 @@ static ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume)
return wined3d_texture_decref(volume->container);
}
struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volume *volume)
{
TRACE("volume %p.\n", volume);
return &volume->resource;
}
static BOOL volume_check_block_align(const struct wined3d_volume *volume,
const struct wined3d_box *box)
{

View File

@ -282,5 +282,3 @@
@ cdecl wined3d_vertex_declaration_decref(ptr)
@ cdecl wined3d_vertex_declaration_get_parent(ptr)
@ cdecl wined3d_vertex_declaration_incref(ptr)
@ cdecl wined3d_volume_get_resource(ptr)

View File

@ -2568,8 +2568,6 @@ ULONG __cdecl wined3d_vertex_declaration_decref(struct wined3d_vertex_declaratio
void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration);
ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume);
/* Return the integer base-2 logarithm of x. Undefined for x == 0. */
static inline unsigned int wined3d_log2i(unsigned int x)
{