wined3d: Move buffer_get_memory() under wined3d_buffer_load_sysmem().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-10-20 12:50:53 +02:00 committed by Alexandre Julliard
parent 3c847a20c1
commit 8db3b5512e
1 changed files with 25 additions and 25 deletions

View File

@ -504,31 +504,6 @@ static inline unsigned int fixup_transformed_pos(float *p)
return 4 * sizeof(*p);
}
/* Context activation is done by the caller. */
void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *context,
struct wined3d_bo_address *data)
{
data->buffer_object = buffer->buffer_object;
if (!buffer->buffer_object)
{
if ((buffer->flags & WINED3D_BUFFER_USE_BO) && !buffer->resource.map_count)
{
buffer_create_buffer_object(buffer, context);
if (buffer->buffer_object)
{
data->buffer_object = buffer->buffer_object;
data->addr = NULL;
return;
}
}
data->addr = buffer->resource.heap_memory;
}
else
{
data->addr = NULL;
}
}
ULONG CDECL wined3d_buffer_incref(struct wined3d_buffer *buffer)
{
ULONG refcount = InterlockedIncrement(&buffer->resource.ref);
@ -628,6 +603,31 @@ BYTE *wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_c
return buffer->resource.heap_memory;
}
/* Context activation is done by the caller. */
void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *context,
struct wined3d_bo_address *data)
{
data->buffer_object = buffer->buffer_object;
if (!buffer->buffer_object)
{
if ((buffer->flags & WINED3D_BUFFER_USE_BO) && !buffer->resource.map_count)
{
buffer_create_buffer_object(buffer, context);
if (buffer->buffer_object)
{
data->buffer_object = buffer->buffer_object;
data->addr = NULL;
return;
}
}
data->addr = buffer->resource.heap_memory;
}
else
{
data->addr = NULL;
}
}
static void buffer_unload(struct wined3d_resource *resource)
{
struct wined3d_buffer *buffer = buffer_from_resource(resource);