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

wined3d: wined3d_device_set_index_buffer() never fails.

parent 129ad9cb
......@@ -2344,7 +2344,6 @@ static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface,
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
struct d3d8_indexbuffer *ib = unsafe_impl_from_IDirect3DIndexBuffer8(buffer);
HRESULT hr;
TRACE("iface %p, buffer %p, base_vertex_idx %u.\n", iface, buffer, base_vertex_idx);
......@@ -2356,12 +2355,12 @@ static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface,
*/
wined3d_mutex_lock();
wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx);
hr = wined3d_device_set_index_buffer(device->wined3d_device,
wined3d_device_set_index_buffer(device->wined3d_device,
ib ? ib->wined3d_buffer : NULL,
ib ? ib->format : WINED3DFMT_UNKNOWN);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface,
......
......@@ -2524,17 +2524,16 @@ static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
struct d3d9_indexbuffer *ib = unsafe_impl_from_IDirect3DIndexBuffer9(buffer);
HRESULT hr;
TRACE("iface %p, buffer %p.\n", iface, buffer);
wined3d_mutex_lock();
hr = wined3d_device_set_index_buffer(device->wined3d_device,
wined3d_device_set_index_buffer(device->wined3d_device,
ib ? ib->wined3d_buffer : NULL,
ib ? ib->format : WINED3DFMT_UNKNOWN);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 **buffer)
......
......@@ -4158,7 +4158,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
/* Set the index stream */
wined3d_device_set_base_vertex_index(This->wined3d_device, StartVertex);
hr = wined3d_device_set_index_buffer(This->wined3d_device, This->indexbuffer, WINED3DFMT_R16_UINT);
wined3d_device_set_index_buffer(This->wined3d_device, This->indexbuffer, WINED3DFMT_R16_UINT);
/* Set the vertex stream source */
hr = wined3d_device_set_stream_source(This->wined3d_device, 0, vb->wineD3DVertexBuffer, 0, stride);
......
......@@ -2215,7 +2215,7 @@ HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, s
return WINED3D_OK;
}
HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
struct wined3d_buffer *buffer, enum wined3d_format_id format_id)
{
struct wined3d_buffer *prev_buffer;
......@@ -2237,7 +2237,7 @@ HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
wined3d_buffer_incref(buffer);
if (prev_buffer)
wined3d_buffer_decref(prev_buffer);
return WINED3D_OK;
return;
}
if (prev_buffer != buffer)
......@@ -2254,8 +2254,6 @@ HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
wined3d_buffer_decref(prev_buffer);
}
}
return WINED3D_OK;
}
HRESULT CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, struct wined3d_buffer **buffer)
......
......@@ -2204,7 +2204,7 @@ HRESULT __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device,
HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs);
void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device,
UINT swapchain_idx, DWORD flags, const struct wined3d_gamma_ramp *ramp);
HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
void __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
struct wined3d_buffer *index_buffer, enum wined3d_format_id format_id);
HRESULT __cdecl wined3d_device_set_light(struct wined3d_device *device,
UINT light_idx, const struct wined3d_light *light);
......
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