mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
[simd] Make mmulf safe for src=dst
I guess I'd forgotten that the parameters are actually pointers.
This commit is contained in:
parent
c86f0c9449
commit
cb7d2671d8
1 changed files with 10 additions and 4 deletions
|
@ -77,10 +77,16 @@ VISIBLE
|
|||
void
|
||||
mmulf (mat4f_t c, const mat4f_t a, const mat4f_t b)
|
||||
{
|
||||
c[0] = a[0] * b[0][0] + a[1] * b[0][1] + a[2] * b[0][2] + a[3] * b[0][3];
|
||||
c[1] = a[0] * b[1][0] + a[1] * b[1][1] + a[2] * b[1][2] + a[3] * b[1][3];
|
||||
c[2] = a[0] * b[2][0] + a[1] * b[2][1] + a[2] * b[2][2] + a[3] * b[2][3];
|
||||
c[3] = a[0] * b[3][0] + a[1] * b[3][1] + a[2] * b[3][2] + a[3] * b[3][3];
|
||||
mat4f_t t;
|
||||
t[0] = a[0] * b[0][0] + a[1] * b[0][1] + a[2] * b[0][2] + a[3] * b[0][3];
|
||||
t[1] = a[0] * b[1][0] + a[1] * b[1][1] + a[2] * b[1][2] + a[3] * b[1][3];
|
||||
t[2] = a[0] * b[2][0] + a[1] * b[2][1] + a[2] * b[2][2] + a[3] * b[2][3];
|
||||
t[3] = a[0] * b[3][0] + a[1] * b[3][1] + a[2] * b[3][2] + a[3] * b[3][3];
|
||||
|
||||
c[0] = t[0];
|
||||
c[1] = t[1];
|
||||
c[2] = t[2];
|
||||
c[3] = t[3];
|
||||
}
|
||||
|
||||
#ifndef IMPLEMENT_MAT4F_Funcs
|
||||
|
|
Loading…
Reference in a new issue