3131#include < cmath>
3232#endif
3333
34-
3534#include < hiprt/hiprt_common.h>
3635#if defined( __KERNELCC__ )
3736#include < hiprt/hiprt_device.h>
3837#endif
3938
40-
41-
42-
43-
4439#if !defined( __KERNELCC__ )
4540#define uint2 hiprtUint2
4641
6156#define make_float4 make_hiprtFloat4
6257#endif
6358
64-
6559static constexpr bool UseDynamicStack = false ;
6660
67-
6861#if defined( __KERNELCC__ )
6962typedef typename hiprt::conditional<UseDynamicStack, hiprtDynamicStack, hiprtGlobalStack>::type Stack;
7063typedef hiprtEmptyInstanceStack InstanceStack;
7164#endif
7265
73-
7466struct float4x4
7567{
7668 union
@@ -80,7 +72,6 @@ struct float4x4
8072 };
8173};
8274
83-
8475enum
8576{
8677 VisualizeColor,
@@ -115,8 +106,6 @@ struct Camera
115106 float m_fov;
116107};
117108
118-
119-
120109HIPRT_HOST_DEVICE HIPRT_INLINE uint32_t lcg ( uint32_t & seed )
121110{
122111 constexpr uint32_t LcgA = 1103515245u ;
@@ -126,7 +115,10 @@ HIPRT_HOST_DEVICE HIPRT_INLINE uint32_t lcg( uint32_t& seed )
126115 return seed & LcgM;
127116}
128117
129- HIPRT_HOST_DEVICE HIPRT_INLINE float randf ( uint32_t & seed ) { return ( static_cast <float >( lcg ( seed ) ) / static_cast <float >( 0x01000000 ) ); }
118+ HIPRT_HOST_DEVICE HIPRT_INLINE float randf ( uint32_t & seed )
119+ {
120+ return ( static_cast <float >( lcg ( seed ) ) / static_cast <float >( 0x01000000 ) );
121+ }
130122
131123template <uint32_t N>
132124HIPRT_HOST_DEVICE HIPRT_INLINE uint2 tea ( uint32_t val0, uint32_t val1 )
@@ -145,8 +137,6 @@ HIPRT_HOST_DEVICE HIPRT_INLINE uint2 tea( uint32_t val0, uint32_t val1 )
145137 return make_uint2 ( v0, v1 );
146138}
147139
148-
149-
150140#define RT_MIN ( a, b ) ( ( ( b ) < ( a ) ) ? ( b ) : ( a ) )
151141#define RT_MAX ( a, b ) ( ( ( b ) > ( a ) ) ? ( b ) : ( a ) )
152142
@@ -1099,7 +1089,6 @@ HIPRT_HOST_DEVICE HIPRT_INLINE float3 rotate( const float4& rotation, const floa
10991089 return 2 .0f * dot ( a, p ) * a + ( c * c - dot ( a, a ) ) * p + 2 .0f * c * cross ( a, p );
11001090}
11011091
1102-
11031092HIPRT_HOST_DEVICE HIPRT_INLINE hiprtRay
11041093generateRay ( float x, float y, int2 res, const Camera& camera, uint32_t & seed, bool isMultiSamples )
11051094{
@@ -1118,4 +1107,3 @@ generateRay( float x, float y, int2 res, const Camera& camera, uint32_t& seed, b
11181107 ray.direction = normalize ( dir.x * holDir + dir.y * upDir + dir.z * viewDir );
11191108 return ray;
11201109}
1121-
0 commit comments