wined3d: Return data as struct wined3d_bo_address in buffer_get_memory().

This commit is contained in:
Henri Verbeet 2011-07-11 01:06:45 +02:00 committed by Alexandre Julliard
parent a3538a1546
commit 89bf30a25e
3 changed files with 11 additions and 10 deletions

View File

@ -467,10 +467,10 @@ static inline void fixup_transformed_pos(float *p)
}
/* Context activation is done by the caller. */
const BYTE *buffer_get_memory(struct wined3d_buffer *buffer,
const struct wined3d_gl_info *gl_info, GLuint *buffer_object)
void buffer_get_memory(struct wined3d_buffer *buffer, const struct wined3d_gl_info *gl_info,
struct wined3d_bo_address *data)
{
*buffer_object = buffer->buffer_object;
data->buffer_object = buffer->buffer_object;
if (!buffer->buffer_object)
{
if (buffer->flags & WINED3D_BUFFER_CREATEBO)
@ -479,15 +479,16 @@ const BYTE *buffer_get_memory(struct wined3d_buffer *buffer,
buffer->flags &= ~WINED3D_BUFFER_CREATEBO;
if (buffer->buffer_object)
{
*buffer_object = buffer->buffer_object;
return NULL;
data->buffer_object = buffer->buffer_object;
data->addr = NULL;
return;
}
}
return buffer->resource.allocatedMemory;
data->addr = buffer->resource.allocatedMemory;
}
else
{
return NULL;
data->addr = NULL;
}
}

View File

@ -213,7 +213,7 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
else
{
TRACE("Stream %u isn't UP, %p\n", element->input_slot, buffer);
data.addr = buffer_get_memory(buffer, &device->adapter->gl_info, &data.buffer_object);
buffer_get_memory(buffer, &device->adapter->gl_info, &data);
/* Can't use vbo's if the base vertex index is negative. OpenGL doesn't accept negative offsets
* (or rather offsets bigger than the vbo, because the pointer is unsigned), so use system memory

View File

@ -2405,8 +2405,8 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc
return CONTAINING_RECORD(resource, struct wined3d_buffer, resource);
}
const BYTE *buffer_get_memory(struct wined3d_buffer *buffer, const struct wined3d_gl_info *gl_info,
GLuint *buffer_object) DECLSPEC_HIDDEN;
void buffer_get_memory(struct wined3d_buffer *buffer, const struct wined3d_gl_info *gl_info,
struct wined3d_bo_address *data) DECLSPEC_HIDDEN;
BYTE *buffer_get_sysmem(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
struct wined3d_rendertarget_view