Module: wine Branch: master Commit: fca636a01cfd1ef213326125582139bdd72a287a URL: http://source.winehq.org/git/wine.git/?a=commit;h=fca636a01cfd1ef21332612558...
Author: Riccardo Bortolato rikyz619@gmail.com Date: Wed Oct 7 19:04:33 2015 +0200
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
---
dlls/d3d9/d3d9_private.h | 3 +-- dlls/d3d9/device.c | 2 +- dlls/d3d9/volume.c | 9 ++++----- dlls/wined3d/volume.c | 7 ------- dlls/wined3d/wined3d.spec | 2 -- include/wine/wined3d.h | 2 -- 6 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 28db978..ea0d3e6 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -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 { diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 5568cc8..35abb13 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -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);
diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c index dde8980..ca72f99 100644 --- a/dlls/d3d9/volume.c +++ b/dlls/d3d9/volume.c @@ -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; diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index 608f0c0..ef5a999 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -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) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 0efa91c..c4ebd35 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -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) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 7422545..a354308 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -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) {