Commit cf119337 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Remove wined3d_buffer_set/get_priority.

parent 086545cd
......@@ -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;
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment