Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/d3d9/device.c | 15 +++++++++++---- dlls/wined3d/buffer.c | 18 ------------------ dlls/wined3d/wined3d.spec | 1 - include/wine/wined3d.h | 3 --- 4 files changed, 11 insertions(+), 26 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 954f3fa..8f992ba 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2646,15 +2646,22 @@ static HRESULT d3d9_device_prepare_index_buffer(struct d3d9_device *device, UINT if (device->index_buffer_size < min_size || !device->index_buffer) { UINT size = max(device->index_buffer_size * 2, min_size); + struct wined3d_buffer_desc desc; struct wined3d_buffer *buffer;
TRACE("Growing index buffer to %u bytes.\n", size);
- hr = wined3d_buffer_create_ib(device->wined3d_device, size, WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY, - WINED3D_POOL_DEFAULT, NULL, &d3d9_null_wined3d_parent_ops, &buffer); - if (FAILED(hr)) + desc.byte_width = size; + desc.usage = WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY | WINED3DUSAGE_STATICDECL; + desc.bind_flags = WINED3D_BIND_INDEX_BUFFER; + desc.access = WINED3D_RESOURCE_ACCESS_GPU; + desc.misc_flags = 0; + desc.structure_byte_stride = 0; + + if (FAILED(hr = wined3d_buffer_create(device->wined3d_device, &desc, + NULL, NULL, &d3d9_null_wined3d_parent_ops, &buffer))) { - ERR("(%p) wined3d_buffer_create_ib failed with hr = %08x.\n", device, hr); + ERR("Failed to create index buffer, hr %#x.\n", hr); return hr; }
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 593d886..f1b4556 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1487,21 +1487,3 @@ HRESULT CDECL wined3d_buffer_create_vb(struct wined3d_device *device, UINT size,
return wined3d_buffer_create(device, &desc, NULL, parent, parent_ops, buffer); } - -HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, DWORD usage, enum wined3d_pool pool, - void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer) -{ - struct wined3d_buffer_desc desc; - - TRACE("device %p, size %u, usage %#x, pool %#x, parent %p, parent_ops %p, buffer %p.\n", - device, size, usage, pool, parent, parent_ops, buffer); - - desc.byte_width = size; - desc.usage = usage | WINED3DUSAGE_STATICDECL; - desc.bind_flags = WINED3D_BIND_INDEX_BUFFER; - desc.access = resource_access_from_pool(pool); - desc.misc_flags = 0; - desc.structure_byte_stride = 0; - - return wined3d_buffer_create(device, &desc, NULL, parent, parent_ops, buffer); -} diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 74e61ea..606ba0b 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -23,7 +23,6 @@ @ cdecl wined3d_set_adapter_display_mode(ptr long ptr)
@ cdecl wined3d_buffer_create(ptr ptr ptr ptr ptr ptr) -@ cdecl wined3d_buffer_create_ib(ptr long long long ptr ptr ptr) @ cdecl wined3d_buffer_create_vb(ptr long long long ptr ptr ptr) @ cdecl wined3d_buffer_decref(ptr) @ cdecl wined3d_buffer_get_parent(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 72168e5..2a79602 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2189,9 +2189,6 @@ HRESULT __cdecl wined3d_set_adapter_display_mode(struct wined3d *wined3d, HRESULT __cdecl wined3d_buffer_create(struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer); -HRESULT __cdecl wined3d_buffer_create_ib(struct wined3d_device *device, UINT length, DWORD usage, - enum wined3d_pool pool, void *parent, const struct wined3d_parent_ops *parent_ops, - struct wined3d_buffer **buffer); HRESULT __cdecl wined3d_buffer_create_vb(struct wined3d_device *device, UINT length, DWORD usage, enum wined3d_pool pool, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);