Commit 39876236 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d9: Use wined3d_bit_scan() instead of open-coding it.

parent 5c3d4f39
...@@ -2732,8 +2732,7 @@ static void d3d9_device_upload_sysmem_vertex_buffers(struct d3d9_device *device, ...@@ -2732,8 +2732,7 @@ static void d3d9_device_upload_sysmem_vertex_buffers(struct d3d9_device *device,
map = device->sysmem_vb; map = device->sysmem_vb;
while (map) while (map)
{ {
i = ffs(map) - 1; i = wined3d_bit_scan(&map);
map ^= 1u << i;
if (FAILED(hr = wined3d_device_get_stream_source(device->wined3d_device, i, &dst_buffer, &offset, &stride))) if (FAILED(hr = wined3d_device_get_stream_source(device->wined3d_device, i, &dst_buffer, &offset, &stride)))
ERR("Failed to get stream source.\n"); ERR("Failed to get stream source.\n");
...@@ -3111,8 +3110,7 @@ static HRESULT WINAPI d3d9_device_ProcessVertices(IDirect3DDevice9Ex *iface, ...@@ -3111,8 +3110,7 @@ static HRESULT WINAPI d3d9_device_ProcessVertices(IDirect3DDevice9Ex *iface,
map = device->sysmem_vb; map = device->sysmem_vb;
while (map) while (map)
{ {
i = ffs(map) - 1; i = wined3d_bit_scan(&map);
map ^= 1u << i;
if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, if (FAILED(wined3d_device_get_stream_source(device->wined3d_device,
i, &wined3d_buffer, &offset, &stride))) i, &wined3d_buffer, &offset, &stride)))
...@@ -3130,8 +3128,7 @@ static HRESULT WINAPI d3d9_device_ProcessVertices(IDirect3DDevice9Ex *iface, ...@@ -3130,8 +3128,7 @@ static HRESULT WINAPI d3d9_device_ProcessVertices(IDirect3DDevice9Ex *iface,
map = device->sysmem_vb; map = device->sysmem_vb;
while (map) while (map)
{ {
i = ffs(map) - 1; i = wined3d_bit_scan(&map);
map ^= 1u << i;
if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, if (FAILED(wined3d_device_get_stream_source(device->wined3d_device,
i, &wined3d_buffer, &offset, &stride))) i, &wined3d_buffer, &offset, &stride)))
......
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