NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::Platform Class Reference

Class holding various SAH and batch processing parameters. More...

#include <Platform.hpp>

Public Member Functions

 Platform ()
 Constructor. More...
 
 Platform (const String &name, float nodeCost=1.f, float triCost=1.f, S32 nodeBatchSize=1, S32 triBatchSize=1)
 Constructor. More...
 
const StringgetName () const
 
float getSAHTriangleCost () const
 
float getSAHNodeCost () const
 
float getCost (int numChildNodes, int numTris) const
 Calculates cost of a single node. More...
 
float getTriangleCost (S32 n) const
 Calcuates cost of a given number of triangles rounded to the batch size. More...
 
float getNodeCost (S32 n) const
 Calculates cost of a given number of nodes rounded to the batch size. More...
 
S32 getTriangleBatchSize () const
 
S32 getNodeBatchSize () const
 
void setTriangleBatchSize (S32 triBatchSize)
 Sets triangle batch size to a given value. More...
 
void setNodeBatchSize (S32 nodeBatchSize)
 Sets node batch size to a given value. More...
 
S32 roundToTriangleBatchSize (S32 n) const
 Rounds given value up to the nearest triangle batch size multiple. More...
 
S32 roundToNodeBatchSize (S32 n) const
 Rounds given value up to the nearest node batch size multiple. More...
 
void setLeafPreferences (S32 minSize, S32 maxSize)
 Sets leaf size preferences (desired number of triangles in one leaf node). More...
 
S32 getMinLeafSize () const
 
S32 getMaxLeafSize () const
 
U32 computeHash () const
 

Detailed Description

Class holding various SAH and batch processing parameters.

Definition at line 46 of file Platform.hpp.

Constructor & Destructor Documentation

FW::Platform::Platform ( )
inline

Constructor.

Definition at line 53 of file Platform.hpp.

FW::Platform::Platform ( const String name,
float  nodeCost = 1.f,
float  triCost = 1.f,
S32  nodeBatchSize = 1,
S32  triBatchSize = 1 
)
inline

Constructor.

Parameters
[in]nameName of the platform settings.
[in]nodeCostCost of a single node.
[in]triCostCost of a single triangle.
[in]nodeBatchSizeSize of a node batch.
[in]triBatchSizeSize of a triangle batch.

Definition at line 63 of file Platform.hpp.

Member Function Documentation

U32 FW::Platform::computeHash ( ) const
inline
Returns
Hash of the platform settings.

Definition at line 162 of file Platform.hpp.

float FW::Platform::getCost ( int  numChildNodes,
int  numTris 
) const
inline

Calculates cost of a single node.

Parameters
[in]numChildNodesNumber of child nodes.
[in]numTrixNumber of triangles.
Returns
SAH cost of a node.

Definition at line 88 of file Platform.hpp.

S32 FW::Platform::getMaxLeafSize ( ) const
inline
Returns
Maximum leaf size.

Definition at line 157 of file Platform.hpp.

S32 FW::Platform::getMinLeafSize ( ) const
inline
Returns
Minimum leaf size.

Definition at line 152 of file Platform.hpp.

const String& FW::Platform::getName ( ) const
inline
Returns
Name of the platform settings.

Definition at line 68 of file Platform.hpp.

S32 FW::Platform::getNodeBatchSize ( ) const
inline
Returns
Size of the node batch.

Definition at line 113 of file Platform.hpp.

float FW::Platform::getNodeCost ( S32  n) const
inline

Calculates cost of a given number of nodes rounded to the batch size.

Parameters
[in]nNumber of nodes.
Returns
Cost of nodes.

Definition at line 102 of file Platform.hpp.

float FW::Platform::getSAHNodeCost ( ) const
inline
Returns
SAH cost of a single node.

Definition at line 79 of file Platform.hpp.

float FW::Platform::getSAHTriangleCost ( ) const
inline
Returns
SAH cost of a single triangle.

Definition at line 74 of file Platform.hpp.

S32 FW::Platform::getTriangleBatchSize ( ) const
inline
Returns
Size of the triangle batch.

Definition at line 108 of file Platform.hpp.

float FW::Platform::getTriangleCost ( S32  n) const
inline

Calcuates cost of a given number of triangles rounded to the batch size.

Parameters
[in]nNumber of triangles.
Returns
Cost of triangles.

Definition at line 95 of file Platform.hpp.

S32 FW::Platform::roundToNodeBatchSize ( S32  n) const
inline

Rounds given value up to the nearest node batch size multiple.

Parameters
[in]nValue to be rounded.
Returns
Rounded value.

Definition at line 139 of file Platform.hpp.

S32 FW::Platform::roundToTriangleBatchSize ( S32  n) const
inline

Rounds given value up to the nearest triangle batch size multiple.

Parameters
[in]nValue to be rounded.
Returns
Rounded value.

Definition at line 132 of file Platform.hpp.

void FW::Platform::setLeafPreferences ( S32  minSize,
S32  maxSize 
)
inline

Sets leaf size preferences (desired number of triangles in one leaf node).

Parameters
[in]minSizeMinimum leaf size.
[in]maxSizeMaximum leaf size.

Definition at line 147 of file Platform.hpp.

void FW::Platform::setNodeBatchSize ( S32  nodeBatchSize)
inline

Sets node batch size to a given value.

Parameters
[in]nodeBatchSizeNew node batch size.

Definition at line 125 of file Platform.hpp.

void FW::Platform::setTriangleBatchSize ( S32  triBatchSize)
inline

Sets triangle batch size to a given value.

Parameters
[in]triBatchSizeNew triangle batch size.

Definition at line 119 of file Platform.hpp.


The documentation for this class was generated from the following file: