ddraw: Use wined3d_buffer_create() in d3d_device_prepare_vertex_buffer().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f181da61a0
commit
3aafba2b69
|
@ -3465,15 +3465,22 @@ static HRESULT d3d_device_prepare_vertex_buffer(struct d3d_device *device, UINT
|
||||||
if (device->vertex_buffer_size < min_size || !device->vertex_buffer)
|
if (device->vertex_buffer_size < min_size || !device->vertex_buffer)
|
||||||
{
|
{
|
||||||
UINT size = max(device->vertex_buffer_size * 2, min_size);
|
UINT size = max(device->vertex_buffer_size * 2, min_size);
|
||||||
|
struct wined3d_buffer_desc desc;
|
||||||
struct wined3d_buffer *buffer;
|
struct wined3d_buffer *buffer;
|
||||||
|
|
||||||
TRACE("Growing vertex buffer to %u bytes\n", size);
|
TRACE("Growing vertex buffer to %u bytes\n", size);
|
||||||
|
|
||||||
hr = wined3d_buffer_create_vb(device->wined3d_device, size, WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY,
|
desc.byte_width = size;
|
||||||
WINED3D_POOL_DEFAULT, NULL, &ddraw_null_wined3d_parent_ops, &buffer);
|
desc.usage = WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY;
|
||||||
if (FAILED(hr))
|
desc.bind_flags = WINED3D_BIND_VERTEX_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, &ddraw_null_wined3d_parent_ops, &buffer)))
|
||||||
{
|
{
|
||||||
ERR("(%p) wined3d_buffer_create_vb failed with hr = %08x\n", device, hr);
|
ERR("Failed to create vertex buffer, hr %#x.\n", hr);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue