wined3d: Introduce a separate structure for OpenGL buffer information.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-10-26 16:43:07 +03:30 committed by Alexandre Julliard
parent 09c4e23ed5
commit 15962381e2
2 changed files with 14 additions and 4 deletions

View File

@ -782,7 +782,7 @@ static void wined3d_buffer_destroy_object(void *object)
}
heap_free(buffer->maps);
heap_free(buffer);
heap_free(wined3d_buffer_gl(buffer));
}
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
@ -1444,7 +1444,7 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct
const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_buffer **buffer)
{
struct wined3d_buffer *object;
struct wined3d_buffer_gl *object;
HRESULT hr;
TRACE("device %p, desc byte_width %u, usage %s, bind_flags %s, access %s, data %p, parent %p, "
@ -1456,7 +1456,7 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = wined3d_buffer_init(object, device, desc, data, parent, parent_ops)))
if (FAILED(hr = wined3d_buffer_init(&object->b, device, desc, data, parent, parent_ops)))
{
WARN("Failed to initialize buffer, hr %#x.\n", hr);
heap_free(object);
@ -1465,7 +1465,7 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct
TRACE("Created buffer %p.\n", object);
*buffer = object;
*buffer = &object->b;
return WINED3D_OK;
}

View File

@ -3796,6 +3796,16 @@ void wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_off
void wined3d_buffer_upload_data(struct wined3d_buffer *buffer, struct wined3d_context *context,
const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN;
struct wined3d_buffer_gl
{
struct wined3d_buffer b;
};
static inline struct wined3d_buffer_gl *wined3d_buffer_gl(struct wined3d_buffer *buffer)
{
return CONTAINING_RECORD(buffer, struct wined3d_buffer_gl, b);
}
struct wined3d_rendertarget_view
{
LONG refcount;