[PATCH 4/5] d3dx9: Copy the entire vector at once if there is no need of type conversions.

Matteo Bruni mbruni at codeweavers.com
Mon Apr 14 12:32:59 CDT 2014


---
 dlls/d3dx9_36/effect.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index f136fb7..9988f7c 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -740,6 +740,12 @@ static void set_vector(struct d3dx_parameter *param, const D3DXVECTOR4 *vector)
 {
     UINT i;
 
+    if (param->type == D3DXPT_FLOAT)
+    {
+        memcpy(param->data, vector, param->columns * sizeof(float));
+        return;
+    }
+
     for (i = 0; i < param->columns; ++i)
     {
         set_number((FLOAT *)param->data + i, param->type, (FLOAT *)vector + i, D3DXPT_FLOAT);
-- 
1.8.3.2




More information about the wine-patches mailing list