Commit 9c8c3911 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make wined3d_device_get_vs_consts_b() consistent with wined3d_device_get_vs_consts_f().

parent 73ba8765
...@@ -2899,7 +2899,7 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantB(IDirect3DDevice9Ex *i ...@@ -2899,7 +2899,7 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantB(IDirect3DDevice9Ex *i
TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_device_get_vs_consts_b(device->wined3d_device, reg_idx, data, count); hr = wined3d_device_get_vs_consts_b(device->wined3d_device, reg_idx, count, data);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -2407,17 +2407,17 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, ...@@ -2407,17 +2407,17 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
} }
HRESULT CDECL wined3d_device_get_vs_consts_b(const struct wined3d_device *device, HRESULT CDECL wined3d_device_get_vs_consts_b(const struct wined3d_device *device,
UINT start_register, BOOL *constants, UINT bool_count) unsigned int start_idx, unsigned int count, BOOL *constants)
{ {
UINT count = min(bool_count, WINED3D_MAX_CONSTS_B - start_register); TRACE("device %p, start_idx %u, count %u, constants %p.\n",
device, start_idx, count, constants);
TRACE("device %p, start_register %u, constants %p, bool_count %u.\n",
device, start_register, constants, bool_count);
if (!constants || start_register >= WINED3D_MAX_CONSTS_B) if (!constants || start_idx >= WINED3D_MAX_CONSTS_B)
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
memcpy(constants, &device->state.vs_consts_b[start_register], count * sizeof(BOOL)); if (count > WINED3D_MAX_CONSTS_B - start_idx)
count = WINED3D_MAX_CONSTS_B - start_idx;
memcpy(constants, &device->state.vs_consts_b[start_idx], count * sizeof(*constants));
return WINED3D_OK; return WINED3D_OK;
} }
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
@ cdecl wined3d_device_get_vertex_shader(ptr) @ cdecl wined3d_device_get_vertex_shader(ptr)
@ cdecl wined3d_device_get_viewport(ptr ptr) @ cdecl wined3d_device_get_viewport(ptr ptr)
@ cdecl wined3d_device_get_vs_cb(ptr long) @ cdecl wined3d_device_get_vs_cb(ptr long)
@ cdecl wined3d_device_get_vs_consts_b(ptr long ptr long) @ cdecl wined3d_device_get_vs_consts_b(ptr long long ptr)
@ cdecl wined3d_device_get_vs_consts_f(ptr long long ptr) @ cdecl wined3d_device_get_vs_consts_f(ptr long long ptr)
@ cdecl wined3d_device_get_vs_consts_i(ptr long long ptr) @ cdecl wined3d_device_get_vs_consts_i(ptr long long ptr)
@ cdecl wined3d_device_get_vs_resource_view(ptr long) @ cdecl wined3d_device_get_vs_resource_view(ptr long)
......
...@@ -2159,7 +2159,7 @@ struct wined3d_shader * __cdecl wined3d_device_get_vertex_shader(const struct wi ...@@ -2159,7 +2159,7 @@ struct wined3d_shader * __cdecl wined3d_device_get_vertex_shader(const struct wi
void __cdecl wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport); void __cdecl wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport);
struct wined3d_buffer * __cdecl wined3d_device_get_vs_cb(const struct wined3d_device *device, UINT idx); struct wined3d_buffer * __cdecl wined3d_device_get_vs_cb(const struct wined3d_device *device, UINT idx);
HRESULT __cdecl wined3d_device_get_vs_consts_b(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_vs_consts_b(const struct wined3d_device *device,
UINT start_register, BOOL *constants, UINT bool_count); unsigned int start_idx, unsigned int count, BOOL *constants);
HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *device,
unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants); unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants);
HRESULT __cdecl wined3d_device_get_vs_consts_i(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_vs_consts_i(const struct wined3d_device *device,
......
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