Commit 73ba8765 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make wined3d_device_set_vs_consts_b() consistent with wined3d_device_set_vs_consts_f().

parent 076697e3
...@@ -2884,7 +2884,7 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(IDirect3DDevice9Ex *i ...@@ -2884,7 +2884,7 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(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_set_vs_consts_b(device->wined3d_device, reg_idx, data, count); hr = wined3d_device_set_vs_consts_b(device->wined3d_device, reg_idx, count, data);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -2374,24 +2374,28 @@ static void device_invalidate_shader_constants(const struct wined3d_device *devi ...@@ -2374,24 +2374,28 @@ static void device_invalidate_shader_constants(const struct wined3d_device *devi
} }
HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
UINT start_register, const BOOL *constants, UINT bool_count) unsigned int start_idx, unsigned int count, const BOOL *constants)
{ {
UINT count = min(bool_count, WINED3D_MAX_CONSTS_B - start_register); unsigned int i;
UINT i;
TRACE("device %p, start_register %u, constants %p, bool_count %u.\n", TRACE("device %p, start_idx %u, count %u, constants %p.\n",
device, start_register, constants, bool_count); device, start_idx, count, constants);
if (!constants || start_register >= WINED3D_MAX_CONSTS_B) if (!constants || start_idx >= WINED3D_MAX_CONSTS_B)
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
memcpy(&device->update_state->vs_consts_b[start_register], constants, count * sizeof(BOOL)); if (count > WINED3D_MAX_CONSTS_B - start_idx)
for (i = 0; i < count; ++i) count = WINED3D_MAX_CONSTS_B - start_idx;
TRACE("Set BOOL constant %u to %s.\n", start_register + i, constants[i] ? "true" : "false"); memcpy(&device->update_state->vs_consts_b[start_idx], constants, count * sizeof(*constants));
if (TRACE_ON(d3d))
{
for (i = 0; i < count; ++i)
TRACE("Set BOOL constant %u to %#x.\n", start_idx + i, constants[i]);
}
if (device->recording) if (device->recording)
{ {
for (i = start_register; i < count + start_register; ++i) for (i = start_idx; i < count + start_idx; ++i)
device->recording->changed.vertexShaderConstantsB |= (1u << i); device->recording->changed.vertexShaderConstantsB |= (1u << i);
} }
else else
......
...@@ -911,7 +911,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) ...@@ -911,7 +911,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
for (i = 0; i < stateblock->num_contained_vs_consts_b; ++i) for (i = 0; i < stateblock->num_contained_vs_consts_b; ++i)
{ {
wined3d_device_set_vs_consts_b(device, stateblock->contained_vs_consts_b[i], wined3d_device_set_vs_consts_b(device, stateblock->contained_vs_consts_b[i],
stateblock->state.vs_consts_b + stateblock->contained_vs_consts_b[i], 1); 1, &stateblock->state.vs_consts_b[stateblock->contained_vs_consts_b[i]]);
} }
apply_lights(device, &stateblock->state); apply_lights(device, &stateblock->state);
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
@ cdecl wined3d_device_set_vertex_shader(ptr ptr) @ cdecl wined3d_device_set_vertex_shader(ptr ptr)
@ cdecl wined3d_device_set_viewport(ptr ptr) @ cdecl wined3d_device_set_viewport(ptr ptr)
@ cdecl wined3d_device_set_vs_cb(ptr long ptr) @ cdecl wined3d_device_set_vs_cb(ptr long ptr)
@ cdecl wined3d_device_set_vs_consts_b(ptr long ptr long) @ cdecl wined3d_device_set_vs_consts_b(ptr long long ptr)
@ cdecl wined3d_device_set_vs_consts_f(ptr long long ptr) @ cdecl wined3d_device_set_vs_consts_f(ptr long long ptr)
@ cdecl wined3d_device_set_vs_consts_i(ptr long long ptr) @ cdecl wined3d_device_set_vs_consts_i(ptr long long ptr)
@ cdecl wined3d_device_set_vs_resource_view(ptr long ptr) @ cdecl wined3d_device_set_vs_resource_view(ptr long ptr)
......
...@@ -2247,7 +2247,7 @@ void __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, str ...@@ -2247,7 +2247,7 @@ void __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, str
void __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport); void __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport);
void __cdecl wined3d_device_set_vs_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer); void __cdecl wined3d_device_set_vs_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer);
HRESULT __cdecl wined3d_device_set_vs_consts_b(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_vs_consts_b(struct wined3d_device *device,
UINT start_register, const BOOL *constants, UINT bool_count); unsigned int start_idx, unsigned int count, const BOOL *constants);
HRESULT __cdecl wined3d_device_set_vs_consts_f(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_vs_consts_f(struct wined3d_device *device,
unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants); unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants);
HRESULT __cdecl wined3d_device_set_vs_consts_i(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_vs_consts_i(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