mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:15:52 +00:00
[WINESYNC] d3dx9: Use parameter data for the first constant only in d3dx_set_shader_const_state().
Signed-off-by: Paul Gofman <gofmanp@gmail.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f72204abd6037e59ba1bf500a3a9d0316e65a024 by Paul Gofman <gofmanp@gmail.com>
This commit is contained in:
parent
523edfe3eb
commit
4e1377665e
3 changed files with 13 additions and 8 deletions
|
@ -2934,11 +2934,15 @@ static HRESULT d3dx_set_shader_const_state(struct ID3DXEffectImpl *effect, enum
|
|||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (param->bytes % const_tbl[op].elem_size)
|
||||
if (param->bytes % const_tbl[op].elem_size || element_count > 1)
|
||||
{
|
||||
unsigned int param_data_size;
|
||||
|
||||
TRACE("Parameter size %u, rows %u, cols %u.\n", param->bytes, param->rows, param->columns);
|
||||
|
||||
if (++element_count > 1)
|
||||
if (param->bytes % const_tbl[op].elem_size)
|
||||
++element_count;
|
||||
if (element_count > 1)
|
||||
{
|
||||
WARN("Setting %u elements.\n", element_count);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, const_tbl[op].elem_size * element_count);
|
||||
|
@ -2954,9 +2958,10 @@ static HRESULT d3dx_set_shader_const_state(struct ID3DXEffectImpl *effect, enum
|
|||
assert(const_tbl[op].elem_size <= sizeof(value));
|
||||
buffer = &value;
|
||||
}
|
||||
memcpy(buffer, value_ptr, param->bytes);
|
||||
memset((unsigned char *)buffer + param->bytes, 0,
|
||||
const_tbl[op].elem_size * element_count - param->bytes);
|
||||
param_data_size = min(param->bytes, const_tbl[op].elem_size);
|
||||
memcpy(buffer, value_ptr, param_data_size);
|
||||
memset((unsigned char *)buffer + param_data_size, 0,
|
||||
const_tbl[op].elem_size * element_count - param_data_size);
|
||||
}
|
||||
|
||||
switch (op)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue