Commit 112579f4 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d8: Use wined3d_buffer_create() in d3d8_device_prepare_index_buffer().

parent 9801f09b
......@@ -2196,15 +2196,22 @@ static HRESULT d3d8_device_prepare_index_buffer(struct d3d8_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, &d3d8_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, &d3d8_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;
}
......
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