KiCad PCB EDA Suite
Loading...
Searching...
No Matches
3d_fastmath.h File Reference

Defines math related functions. More...

#include <cmath>
#include <cstdint>
#include <cstring>

Go to the source code of this file.

Macros

#define FASTMATH_USE
 
#define L1_CACHE_LINE_SIZE   64
 
#define INTFLOORF(s)   (lrintf( (s) - (0.5f - FLT_EPSILON) ))
 

Functions

float Fast_RandFloat ()
 
int Fast_rand (void)
 
void Fast_srand (unsigned int seed)
 
uint32_t FloatToBits (float f)
 This part contains some functions from the PBRT 3 source code.
 
float BitsToFloat (uint32_t ui)
 
uint64_t FloatToBits (double f)
 
double BitsToFloat (uint64_t ui)
 
float NextFloatUp (float v)
 
float NextFloatDown (float v)
 

Detailed Description

Defines math related functions.

Definition in file 3d_fastmath.h.

Macro Definition Documentation

◆ FASTMATH_USE

#define FASTMATH_USE

Definition at line 39 of file 3d_fastmath.h.

◆ INTFLOORF

#define INTFLOORF (   s)    (lrintf( (s) - (0.5f - FLT_EPSILON) ))

Definition at line 44 of file 3d_fastmath.h.

◆ L1_CACHE_LINE_SIZE

#define L1_CACHE_LINE_SIZE   64

Definition at line 41 of file 3d_fastmath.h.

Function Documentation

◆ BitsToFloat() [1/2]

float BitsToFloat ( uint32_t  ui)
inline

Definition at line 106 of file 3d_fastmath.h.

Referenced by NextFloatDown(), and NextFloatUp().

◆ BitsToFloat() [2/2]

double BitsToFloat ( uint64_t  ui)
inline

Definition at line 126 of file 3d_fastmath.h.

◆ Fast_rand()

int Fast_rand ( void  )

Definition at line 58 of file 3d_fastmath.cpp.

References s_nextRandSeed.

Referenced by POST_SHADER_SSAO::Shade().

◆ Fast_RandFloat()

float Fast_RandFloat ( )

◆ Fast_srand()

void Fast_srand ( unsigned int  seed)

Definition at line 65 of file 3d_fastmath.cpp.

References s_nextRandSeed.

◆ FloatToBits() [1/2]

uint64_t FloatToBits ( double  f)
inline

Definition at line 116 of file 3d_fastmath.h.

◆ FloatToBits() [2/2]

uint32_t FloatToBits ( float  f)
inline

This part contains some functions from the PBRT 3 source code.

https://github.com/mmp/pbrt-v3/blob/master/src/core/pbrt.h

Definition at line 96 of file 3d_fastmath.h.

Referenced by NextFloatDown(), and NextFloatUp().

◆ NextFloatDown()

◆ NextFloatUp()