Remove mm_malloc from raytracer
There is no need to use mm_malloc at this moment. Explanation: 1) It was planned that there was advantadge to use aligned memory but it was not measured the performance. 2) aligned memory is needed for use with SIMD (i.e: SSE) but that is not used at moment. Fixes: lp:1626278 https://bugs.launchpad.net/kicad/+bug/1626278
This commit is contained in:
parent
010c10853c
commit
2a793cc22c
|
@ -71,8 +71,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/range/algorithm/partition.hpp>
|
#include <boost/range/algorithm/partition.hpp>
|
||||||
#include <boost/range/algorithm/nth_element.hpp>
|
#include <boost/range/algorithm/nth_element.hpp>
|
||||||
//#include <mm_malloc.h>
|
#include <stdlib.h>
|
||||||
#include <xmmintrin.h>
|
|
||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <wx/debug.h>
|
#include <wx/debug.h>
|
||||||
|
@ -287,9 +286,8 @@ CBVH_PBRT::CBVH_PBRT( const CGENERICCONTAINER &aObjectContainer,
|
||||||
m_primitives.swap( orderedPrims );
|
m_primitives.swap( orderedPrims );
|
||||||
|
|
||||||
// Compute representation of depth-first traversal of BVH tree
|
// Compute representation of depth-first traversal of BVH tree
|
||||||
m_nodes = static_cast<LinearBVHNode *>( _mm_malloc( sizeof( LinearBVHNode ) *
|
m_nodes = static_cast<LinearBVHNode *>( malloc( sizeof( LinearBVHNode ) *
|
||||||
totalNodes,
|
totalNodes ) );
|
||||||
L1_CACHE_LINE_SIZE ) );
|
|
||||||
m_addresses_pointer_to_mm_free.push_back( m_nodes );
|
m_addresses_pointer_to_mm_free.push_back( m_nodes );
|
||||||
|
|
||||||
for( int i = 0; i < totalNodes; ++i )
|
for( int i = 0; i < totalNodes; ++i )
|
||||||
|
@ -337,7 +335,7 @@ CBVH_PBRT::~CBVH_PBRT()
|
||||||
ii != m_addresses_pointer_to_mm_free.end();
|
ii != m_addresses_pointer_to_mm_free.end();
|
||||||
++ii )
|
++ii )
|
||||||
{
|
{
|
||||||
_mm_free( *ii );
|
free( *ii );
|
||||||
*ii = NULL;
|
*ii = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -461,8 +459,7 @@ BVHBuildNode *CBVH_PBRT::recursiveBuild ( std::vector<BVHPrimitiveInfo> &primiti
|
||||||
(*totalNodes)++;
|
(*totalNodes)++;
|
||||||
|
|
||||||
// !TODO: implement an memory Arena
|
// !TODO: implement an memory Arena
|
||||||
BVHBuildNode *node = static_cast<BVHBuildNode *>( _mm_malloc( sizeof( BVHBuildNode ),
|
BVHBuildNode *node = static_cast<BVHBuildNode *>( malloc( sizeof( BVHBuildNode ) ) );
|
||||||
L1_CACHE_LINE_SIZE ) );
|
|
||||||
m_addresses_pointer_to_mm_free.push_back( node );
|
m_addresses_pointer_to_mm_free.push_back( node );
|
||||||
|
|
||||||
node->bounds.Reset();
|
node->bounds.Reset();
|
||||||
|
@ -774,9 +771,8 @@ BVHBuildNode *CBVH_PBRT::HLBVHBuild( const std::vector<BVHPrimitiveInfo> &primit
|
||||||
const int maxBVHNodes = 2 * numPrimitives;
|
const int maxBVHNodes = 2 * numPrimitives;
|
||||||
|
|
||||||
// !TODO: implement a memory arena
|
// !TODO: implement a memory arena
|
||||||
BVHBuildNode *nodes = static_cast<BVHBuildNode *>( _mm_malloc( maxBVHNodes *
|
BVHBuildNode *nodes = static_cast<BVHBuildNode *>( malloc( maxBVHNodes *
|
||||||
sizeof( BVHBuildNode ),
|
sizeof( BVHBuildNode ) ) );
|
||||||
L1_CACHE_LINE_SIZE ) );
|
|
||||||
|
|
||||||
m_addresses_pointer_to_mm_free.push_back( nodes );
|
m_addresses_pointer_to_mm_free.push_back( nodes );
|
||||||
|
|
||||||
|
@ -965,8 +961,7 @@ BVHBuildNode *CBVH_PBRT::buildUpperSAH(
|
||||||
|
|
||||||
(*totalNodes)++;
|
(*totalNodes)++;
|
||||||
|
|
||||||
BVHBuildNode *node = static_cast<BVHBuildNode *>( _mm_malloc( sizeof( BVHBuildNode ),
|
BVHBuildNode *node = static_cast<BVHBuildNode *>( malloc( sizeof( BVHBuildNode ) ) );
|
||||||
L1_CACHE_LINE_SIZE ) );
|
|
||||||
|
|
||||||
m_addresses_pointer_to_mm_free.push_back( node );
|
m_addresses_pointer_to_mm_free.push_back( node );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue