Commit e6473094 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Explicitly pass GL info to buffer_create_buffer_object().

parent e536f998
...@@ -117,10 +117,9 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g ...@@ -117,10 +117,9 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void buffer_create_buffer_object(struct wined3d_buffer *This) static void buffer_create_buffer_object(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info)
{ {
GLenum error, gl_usage; GLenum error, gl_usage;
const struct wined3d_gl_info *gl_info = &This->resource.device->adapter->gl_info;
TRACE("Creating an OpenGL vertex buffer object for IWineD3DVertexBuffer %p Usage(%s)\n", TRACE("Creating an OpenGL vertex buffer object for IWineD3DVertexBuffer %p Usage(%s)\n",
This, debug_d3dusage(This->resource.usage)); This, debug_d3dusage(This->resource.usage));
...@@ -613,7 +612,7 @@ static inline void fixup_transformed_pos(float *p) ...@@ -613,7 +612,7 @@ static inline void fixup_transformed_pos(float *p)
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
const BYTE *buffer_get_memory(IWineD3DBuffer *iface, GLuint *buffer_object) const BYTE *buffer_get_memory(IWineD3DBuffer *iface, const struct wined3d_gl_info *gl_info, GLuint *buffer_object)
{ {
struct wined3d_buffer *This = (struct wined3d_buffer *)iface; struct wined3d_buffer *This = (struct wined3d_buffer *)iface;
...@@ -622,7 +621,7 @@ const BYTE *buffer_get_memory(IWineD3DBuffer *iface, GLuint *buffer_object) ...@@ -622,7 +621,7 @@ const BYTE *buffer_get_memory(IWineD3DBuffer *iface, GLuint *buffer_object)
{ {
if (This->flags & WINED3D_BUFFER_CREATEBO) if (This->flags & WINED3D_BUFFER_CREATEBO)
{ {
buffer_create_buffer_object(This); buffer_create_buffer_object(This, gl_info);
This->flags &= ~WINED3D_BUFFER_CREATEBO; This->flags &= ~WINED3D_BUFFER_CREATEBO;
if (This->buffer_object) if (This->buffer_object)
{ {
...@@ -946,7 +945,7 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface) ...@@ -946,7 +945,7 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
/* TODO: Make converting independent from VBOs */ /* TODO: Make converting independent from VBOs */
if (This->flags & WINED3D_BUFFER_CREATEBO) if (This->flags & WINED3D_BUFFER_CREATEBO)
{ {
buffer_create_buffer_object(This); buffer_create_buffer_object(This, gl_info);
This->flags &= ~WINED3D_BUFFER_CREATEBO; This->flags &= ~WINED3D_BUFFER_CREATEBO;
} }
else else
......
...@@ -213,7 +213,8 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This, ...@@ -213,7 +213,8 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
else else
{ {
TRACE("Stream %u isn't UP, %p\n", element->input_slot, This->stateBlock->streamSource[element->input_slot]); TRACE("Stream %u isn't UP, %p\n", element->input_slot, This->stateBlock->streamSource[element->input_slot]);
data = buffer_get_memory(This->stateBlock->streamSource[element->input_slot], &buffer_object); data = buffer_get_memory(This->stateBlock->streamSource[element->input_slot],
&This->adapter->gl_info, &buffer_object);
/* Can't use vbo's if the base vertex index is negative. OpenGL doesn't accept negative offsets /* 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 * (or rather offsets bigger than the vbo, because the pointer is unsigned), so use system memory
......
...@@ -2503,7 +2503,8 @@ struct wined3d_buffer ...@@ -2503,7 +2503,8 @@ struct wined3d_buffer
UINT *conversion_shift; /* NULL if no shifted conversion */ UINT *conversion_shift; /* NULL if no shifted conversion */
}; };
const BYTE *buffer_get_memory(IWineD3DBuffer *iface, GLuint *buffer_object) DECLSPEC_HIDDEN; const BYTE *buffer_get_memory(IWineD3DBuffer *iface, const struct wined3d_gl_info *gl_info,
GLuint *buffer_object) DECLSPEC_HIDDEN;
BYTE *buffer_get_sysmem(struct wined3d_buffer *This) DECLSPEC_HIDDEN; BYTE *buffer_get_sysmem(struct wined3d_buffer *This) DECLSPEC_HIDDEN;
HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device, HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
UINT size, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, GLenum bind_hint, UINT size, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, GLenum bind_hint,
......
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