From cf11933701a4e0f6c9fbabda97d11df6465aff43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Wed, 16 Jul 2014 14:39:14 +0200 Subject: [PATCH] wined3d: Remove wined3d_buffer_set/get_priority. --- dlls/d3d8/buffer.c | 16 ++++++++++++---- dlls/d3d9/buffer.c | 16 ++++++++++++---- dlls/wined3d/buffer.c | 10 ---------- dlls/wined3d/resource.c | 4 ++-- dlls/wined3d/texture.c | 4 ++-- dlls/wined3d/wined3d.spec | 4 ++-- dlls/wined3d/wined3d_private.h | 2 -- include/wine/wined3d.h | 4 ++-- 8 files changed, 32 insertions(+), 28 deletions(-) diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c index eac22fad18f..4a0e587b409 100644 --- a/dlls/d3d8/buffer.c +++ b/dlls/d3d8/buffer.c @@ -131,12 +131,14 @@ static HRESULT WINAPI d3d8_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer8 * static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface, DWORD priority) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -145,12 +147,14 @@ static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface, static DWORD WINAPI d3d8_vertexbuffer_GetPriority(IDirect3DVertexBuffer8 *iface) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; @@ -404,12 +408,14 @@ static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *if static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, DWORD priority) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -418,12 +424,14 @@ static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, D static DWORD WINAPI d3d8_indexbuffer_GetPriority(IDirect3DIndexBuffer8 *iface) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; diff --git a/dlls/d3d9/buffer.c b/dlls/d3d9/buffer.c index cc93b1874de..c7db176d73a 100644 --- a/dlls/d3d9/buffer.c +++ b/dlls/d3d9/buffer.c @@ -132,12 +132,14 @@ static HRESULT WINAPI d3d9_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer9 * static DWORD WINAPI d3d9_vertexbuffer_SetPriority(IDirect3DVertexBuffer9 *iface, DWORD priority) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -146,12 +148,14 @@ static DWORD WINAPI d3d9_vertexbuffer_SetPriority(IDirect3DVertexBuffer9 *iface, static DWORD WINAPI d3d9_vertexbuffer_GetPriority(IDirect3DVertexBuffer9 *iface) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; @@ -404,12 +408,14 @@ static HRESULT WINAPI d3d9_indexbuffer_FreePrivateData(IDirect3DIndexBuffer9 *if static DWORD WINAPI d3d9_indexbuffer_SetPriority(IDirect3DIndexBuffer9 *iface, DWORD priority) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); + struct wined3d_resource *resource; DWORD previous; TRACE("iface %p, priority %u.\n", iface, priority); wined3d_mutex_lock(); - previous = wined3d_buffer_set_priority(buffer->wined3d_buffer, priority); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + previous = wined3d_resource_set_priority(resource, priority); wined3d_mutex_unlock(); return previous; @@ -418,12 +424,14 @@ static DWORD WINAPI d3d9_indexbuffer_SetPriority(IDirect3DIndexBuffer9 *iface, D static DWORD WINAPI d3d9_indexbuffer_GetPriority(IDirect3DIndexBuffer9 *iface) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); + const struct wined3d_resource *resource; DWORD priority; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - priority = wined3d_buffer_get_priority(buffer->wined3d_buffer); + resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); + priority = wined3d_resource_get_priority(resource); wined3d_mutex_unlock(); return priority; diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 901382c96d6..fa9ff92a53b 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -577,16 +577,6 @@ void * CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer) return buffer->resource.parent; } -DWORD CDECL wined3d_buffer_set_priority(struct wined3d_buffer *buffer, DWORD priority) -{ - return resource_set_priority(&buffer->resource, priority); -} - -DWORD CDECL wined3d_buffer_get_priority(const struct wined3d_buffer *buffer) -{ - return resource_get_priority(&buffer->resource); -} - /* The caller provides a context and binds the buffer */ static void buffer_sync_apple(struct wined3d_buffer *This, DWORD flags, const struct wined3d_gl_info *gl_info) { diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 934cabc2fe5..2f44d368f32 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -167,7 +167,7 @@ void resource_unload(struct wined3d_resource *resource) resource, resource->type); } -DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority) +DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority) { DWORD prev; @@ -183,7 +183,7 @@ DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority) return prev; } -DWORD resource_get_priority(const struct wined3d_resource *resource) +DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource) { TRACE("resource %p, returning %u.\n", resource, resource->priority); return resource->priority; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index e0e12bc3312..b840b89eb20 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -508,12 +508,12 @@ struct wined3d_resource * CDECL wined3d_texture_get_resource(struct wined3d_text DWORD CDECL wined3d_texture_set_priority(struct wined3d_texture *texture, DWORD priority) { - return resource_set_priority(&texture->resource, priority); + return wined3d_resource_set_priority(&texture->resource, priority); } DWORD CDECL wined3d_texture_get_priority(const struct wined3d_texture *texture) { - return resource_get_priority(&texture->resource); + return wined3d_resource_get_priority(&texture->resource); } /* Context activation is done by the caller */ diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 61fa4817124..f70b03fd442 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -26,12 +26,10 @@ @ cdecl wined3d_buffer_create_vb(ptr long long long ptr ptr ptr) @ cdecl wined3d_buffer_decref(ptr) @ cdecl wined3d_buffer_get_parent(ptr) -@ cdecl wined3d_buffer_get_priority(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_unmap(ptr) @ cdecl wined3d_device_acquire_focus_window(ptr ptr) @@ -174,7 +172,9 @@ @ cdecl wined3d_resource_get_desc(ptr ptr) @ cdecl wined3d_resource_get_parent(ptr) +@ cdecl wined3d_resource_get_priority(ptr) @ cdecl wined3d_resource_set_parent(ptr ptr) +@ cdecl wined3d_resource_set_priority(ptr long) @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr) @ cdecl wined3d_rendertarget_view_decref(ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0c115287034..1d199256778 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2037,14 +2037,12 @@ struct wined3d_resource }; void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -DWORD resource_get_priority(const struct wined3d_resource *resource) DECLSPEC_HIDDEN; HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, enum wined3d_resource_type type, const struct wined3d_format *format, enum wined3d_multisample_type multisample_type, UINT multisample_quality, DWORD usage, enum wined3d_pool pool, UINT width, UINT height, UINT depth, UINT size, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; -DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 0c0c5942b41..e5b21d0a268 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2065,12 +2065,10 @@ HRESULT __cdecl wined3d_buffer_create_vb(struct wined3d_device *device, UINT len struct wined3d_buffer **buffer); ULONG __cdecl wined3d_buffer_decref(struct wined3d_buffer *buffer); void * __cdecl wined3d_buffer_get_parent(const struct wined3d_buffer *buffer); -DWORD __cdecl wined3d_buffer_get_priority(const struct wined3d_buffer *buffer); 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); void __cdecl wined3d_buffer_unmap(struct wined3d_buffer *buffer); HRESULT __cdecl wined3d_device_acquire_focus_window(struct wined3d_device *device, HWND window); @@ -2353,7 +2351,9 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv 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); +DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource); void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent); +DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority); HRESULT __cdecl wined3d_rendertarget_view_create(struct wined3d_resource *resource, void *parent, struct wined3d_rendertarget_view **rendertarget_view); -- 2.11.4.GIT