fix for leak in cloth modifier
- any error in cloth_build_springs wasn't freeing the edge-hash.
- was checking BLI_edgehash_haskey on matching vertices.
- was looping over setting NULL for all elements of a calloc'd array.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59469 954f8c5b-7b00-dc11-b283-0030488c597c
use reserve argument for more edgehashs


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59470 954f8c5b-7b00-dc11-b283-0030488c597c
Cycles: reduce noise using regular path tracing + subsurface scattering with
new cubic and gaussian falloff. Like the branched path tracer, this will now
shade all intersection points instead of using one at random.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59471 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #36541: blender internal raytrace render hangs with high ray depth. The code
here is not efficient for such cases, a ray depth can give up to 2^depth rays due
to the ray splitting in two at each depth. A proper solution requires a better
algorithm, for now I've ensured that you can at least cancel such renders. The
overhead from the extra test_break is negligible.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59472 954f8c5b-7b00-dc11-b283-0030488c597c
revert bucket size change (edgehash was this way for years, since r26206, ghash since r57657)
having 2 free buckets for each entry is faster but uses more memory.

use the original size, best case 3 entries per bucket.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59473 954f8c5b-7b00-dc11-b283-0030488c597c
add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a reserve argument.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59474 954f8c5b-7b00-dc11-b283-0030488c597c
avoid double ghash lookup in sculpt map_insert_vert


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59475 954f8c5b-7b00-dc11-b283-0030488c597c
Fix issue in last subsurface commit with branched path tracing, was rendering too bright.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59476 954f8c5b-7b00-dc11-b283-0030488c597c
cloth spring building: replace MIN2/MAX2 in assignments with a function which orders on assignment.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59477 954f8c5b-7b00-dc11-b283-0030488c597c
cloth was using edgehash not quite correctly:
- was ordering vertex args unnecessarily.
- was adding the same edges multiple times into the edgehash.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59478 954f8c5b-7b00-dc11-b283-0030488c597c
Fix [#36553] Revert modified startup.blend from r59445

Modified startup.blend was a regular blend rather than a start-up file, removing the UserDef section.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59480 954f8c5b-7b00-dc11-b283-0030488c597c
correct error in face walker (was inserting into the wrong ghash which was immediately freed after)


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59481 954f8c5b-7b00-dc11-b283-0030488c597c
Add stdlib.h to solve compilation error caused by missing abort() prototype

Perhaps we'd better move this include to BLI_utildefines as we made with
with other includes needed for BLI_abort?

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59482 954f8c5b-7b00-dc11-b283-0030488c597c
Fix bad draw of plane track when using Tiny display option

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59483 954f8c5b-7b00-dc11-b283-0030488c597c
ghash: reserve size when its known or can be guessed close enough.
also avoid allocs per node in pbvh_bmesh_node_limit_ensure()


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59484 954f8c5b-7b00-dc11-b283-0030488c597c
Quiet annoying VC++ warning C4819: The file contains a character that cannot be represented in the current code page.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59485 954f8c5b-7b00-dc11-b283-0030488c597c
use ints for ghash/edgehash flags, since its allocated theres not much point to try save a few bytes here.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59486 954f8c5b-7b00-dc11-b283-0030488c597c
For pointer hashing use the same method as python, it gives better distribution.

some tests with high poly mesh data in hashes.
- empty buckets before 4-5%, after 1-2%
- speedup for hash lookups, in my tests lookups take approx ~60% of the time they did before.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59487 954f8c5b-7b00-dc11-b283-0030488c597c
doxygen docs for ghash/edgehash


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59490 954f8c5b-7b00-dc11-b283-0030488c597c
merge mempool allocs per chunk, include the data in the BLI_mempool_chunk alloc.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@59492 954f8c5b-7b00-dc11-b283-0030488c597c