d3dx9: Copy the entire matrix at once if there is no need of type conversions.

oldstable
Matteo Bruni 2014-03-17 20:22:56 +01:00 committed by Alexandre Julliard
parent 1e2fbcc99b
commit 5cfca92c53
1 changed files with 10 additions and 0 deletions

View File

@ -768,6 +768,16 @@ static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix)
{
UINT i, k;
if (param->type == D3DXPT_FLOAT)
{
if (param->columns == 4)
memcpy(param->data, matrix->u.m, param->rows * 4 * sizeof(float));
else
for (i = 0; i < param->rows; ++i)
memcpy((float *)param->data + i * param->columns, matrix->u.m + i, param->columns * sizeof(float));
return;
}
for (i = 0; i < param->rows; ++i)
{
for (k = 0; k < param->columns; ++k)