[Bf-committers] [PATCH] Remove all MTC_* matrix/vector references and replace with BLI_arithb

Konstantinos Margaritis markos at codex.gr
Thu Feb 14 20:14:02 CET 2008

Hi all, (new to the list)

As discussed with some developers on #blendercoders (JesterKing, sorry 
mate, don't know your real name :-), I've made a patch to remove all 
references to the (supposedly obsolete) MTC_* matrix/vector 
functions, and I also removed some unused mul_* functions present in 
BLI_arithb.c (these aren't even prototyped, I guess they were 
leftovers from some previous versions). Blender compiles fine with 
this patch, and the MTC_*.{c,h} files can now be removed if you like. 
I've tested the resulting binary with some test scenes and it worked 
fine with no crash/core dump/etc.

In the patch, I've included a CHANGELOG.markos file (just for 
reference, I don't expect it to be included of course), where I 
outline the functions removed and a substitution map listing the old 
functions and their replacements.

The reason for this substitution is that I'm working on SIMD 
optimizations in Blender (SSE/AltiVec and Cell as an ultimate goal), 
and having a clean matrix/vector API to work on is a necessary step. 
Next step is to take out these matrix function in a separate library, 
which will hold all optimized functions, and then it will link with 
the the main program.

Next step is to make some of the code SIMD-friendly, eg make the 
float[4][4] to be forcibly aligned on a 16-byte boundary, pad the 
vectors (float[3]) to be in fact float[4] (again aligned on a 16-byte 
boundary), etc. As discussed with JesterKing and others on IRC, there 
seems to be no objection in me doing this, so I'll proceed and I'll 
let you know of any patches/results.

For me, the ultimate goal is the port to Cell, but I'll just can't 
avoid making some core changes to Blender. I just hope you have no 
objections in this.

Thanks again for a wonderful program :-D

Konstantinos Margaritis
markos at codex.gr
markos at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: blender-arithb-MTC.patch.zip
Type: application/x-zip
Size: 12751 bytes
Desc: not available
Url : http://lists.blender.org/pipermail/bf-committers/attachments/20080214/803febb1/attachment.bin 

More information about the Bf-committers mailing list