Skip to content

Commit 1c92ba6

Browse files
committed
Automatic: Committing clang-format changes
1 parent 1ce5934 commit 1c92ba6

File tree

8 files changed

+85
-137
lines changed

8 files changed

+85
-137
lines changed

tutorials/02_scene_intersection/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,17 @@ class Tutorial : public TutorialBase
8080
sceneInput.instanceMasks = nullptr;
8181
sceneInput.instanceTransformHeaders = nullptr;
8282
CHECK_ORO( oroMalloc( reinterpret_cast<oroDeviceptr*>( &sceneInput.instances ), sizeof( hiprtInstance ) ) );
83-
CHECK_ORO( oroMemcpyHtoD( reinterpret_cast<oroDeviceptr>( sceneInput.instances ), &instance, sizeof( hiprtInstance ) ) );
83+
CHECK_ORO(
84+
oroMemcpyHtoD( reinterpret_cast<oroDeviceptr>( sceneInput.instances ), &instance, sizeof( hiprtInstance ) ) );
8485

8586
hiprtFrameSRT frame;
8687
frame.translation = make_hiprtFloat3( 0.0f, 0.0f, 0.0f );
8788
frame.scale = make_hiprtFloat3( 0.5f, 0.5f, 0.5f );
8889
frame.rotation = make_hiprtFloat4( 0.0f, 0.0f, 1.0f, 0.0f );
8990
sceneInput.frameCount = 1;
9091
CHECK_ORO( oroMalloc( reinterpret_cast<oroDeviceptr*>( &sceneInput.instanceFrames ), sizeof( hiprtFrameSRT ) ) );
91-
CHECK_ORO( oroMemcpyHtoD( reinterpret_cast<oroDeviceptr>( sceneInput.instanceFrames ), &frame, sizeof( hiprtFrameSRT ) ) );
92+
CHECK_ORO(
93+
oroMemcpyHtoD( reinterpret_cast<oroDeviceptr>( sceneInput.instanceFrames ), &frame, sizeof( hiprtFrameSRT ) ) );
9294

9395
size_t sceneTempSize;
9496
hiprtDevicePtr sceneTemp = nullptr;

tutorials/18_shadow_ray/main.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
#include <numeric>
2424
#include <tutorials/common/CornellBox.h>
25-
#include <tutorials/common/TutorialBase.h>
2625
#include <tutorials/common/SceneDemo.h>
26+
#include <tutorials/common/TutorialBase.h>
2727

2828
class Tutorial : public SceneDemo
2929
{
@@ -32,15 +32,8 @@ class Tutorial : public SceneDemo
3232
{
3333
Camera camera = createCamera();
3434

35-
setupScene(
36-
camera,
37-
"../common/meshes/cornellpot/cornellpot.obj",
38-
"../common/meshes/cornellpot/" );
39-
render(
40-
"18_shadow_ray.png",
41-
"../common/ShadowRayKernel.h",
42-
"ShadowRayKernel"
43-
);
35+
setupScene( camera, "../common/meshes/cornellpot/cornellpot.obj", "../common/meshes/cornellpot/" );
36+
render( "18_shadow_ray.png", "../common/ShadowRayKernel.h", "ShadowRayKernel" );
4437
deleteScene( m_scene );
4538
return;
4639
}

tutorials/19_primary_ray/main.cpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
#include <numeric>
2424
#include <tutorials/common/CornellBox.h>
25-
#include <tutorials/common/TutorialBase.h>
2625
#include <tutorials/common/SceneDemo.h>
26+
#include <tutorials/common/TutorialBase.h>
2727

2828
class Tutorial : public SceneDemo
2929
{
@@ -33,16 +33,20 @@ class Tutorial : public SceneDemo
3333

3434
struct OPTION_DEF
3535
{
36-
OPTION_DEF(uint32_t i_, const std::string& name_) { i = i_; name = name_; }
37-
uint32_t i;
36+
OPTION_DEF( uint32_t i_, const std::string& name_ )
37+
{
38+
i = i_;
39+
name = name_;
40+
}
41+
uint32_t i;
3842
std::string name;
3943
};
4044
std::vector<OPTION_DEF> optionsList = {
41-
OPTION_DEF(VisualizeNormal,"normal"),
42-
OPTION_DEF(VisualizeUv,"uv"),
43-
OPTION_DEF(VisualizeId,"primId"),
44-
OPTION_DEF(VisualizeHitDist,"depth"),
45-
};
45+
OPTION_DEF( VisualizeNormal, "normal" ),
46+
OPTION_DEF( VisualizeUv, "uv" ),
47+
OPTION_DEF( VisualizeId, "primId" ),
48+
OPTION_DEF( VisualizeHitDist, "depth" ),
49+
};
4650

4751
Camera camera = createCamera();
4852
setupScene(
@@ -51,19 +55,13 @@ class Tutorial : public SceneDemo
5155
"../common/meshes/cornellpot/",
5256
false,
5357
std::nullopt,
54-
hiprtBuildFlagBitPreferFastBuild
55-
);
58+
hiprtBuildFlagBitPreferFastBuild );
5659

57-
for(const auto& o : optionsList)
60+
for ( const auto& o : optionsList )
5861
{
59-
const std::string kernelName = "PrimaryRayKernel_" + std::to_string( o.i );
62+
const std::string kernelName = "PrimaryRayKernel_" + std::to_string( o.i );
6063

61-
render(
62-
"19_primary_ray_" + o.name + ".png",
63-
"../common/PrimaryRayKernel.h",
64-
kernelName
65-
);
66-
64+
render( "19_primary_ray_" + o.name + ".png", "../common/PrimaryRayKernel.h", kernelName );
6765
}
6866

6967
deleteScene( m_scene );

tutorials/common/Common.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,11 @@
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

@@ -61,16 +56,13 @@
6156
#define make_float4 make_hiprtFloat4
6257
#endif
6358

64-
6559
static constexpr bool UseDynamicStack = false;
6660

67-
6861
#if defined( __KERNELCC__ )
6962
typedef typename hiprt::conditional<UseDynamicStack, hiprtDynamicStack, hiprtGlobalStack>::type Stack;
7063
typedef hiprtEmptyInstanceStack InstanceStack;
7164
#endif
7265

73-
7466
struct float4x4
7567
{
7668
union
@@ -80,7 +72,6 @@ struct float4x4
8072
};
8173
};
8274

83-
8475
enum
8576
{
8677
VisualizeColor,
@@ -115,8 +106,6 @@ struct Camera
115106
float m_fov;
116107
};
117108

118-
119-
120109
HIPRT_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

131123
template <uint32_t N>
132124
HIPRT_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-
11031092
HIPRT_HOST_DEVICE HIPRT_INLINE hiprtRay
11041093
generateRay( 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-

tutorials/common/PrimaryRayKernel.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <hiprt/hiprt_device.h>
3030
#include <hiprt/hiprt_vec.h>
3131

32-
//#include <common/shared.h>
32+
// #include <common/shared.h>
3333

3434
#ifndef BLOCK_SIZE
3535
#define BLOCK_SIZE 1
@@ -98,10 +98,10 @@ template <>
9898
__device__ int3 getColor<VisualizeNormal>(
9999
hiprtScene scene, const hiprtHit& hit, uint32_t* matIndices, Material* materials, uint32_t* matOffsetPerInstance )
100100
{
101-
//float3 n = hiprt::normalize( hiprtVectorObjectToWorld( hit.normal, scene, hit.instanceID ) );
101+
// float3 n = hiprt::normalize( hiprtVectorObjectToWorld( hit.normal, scene, hit.instanceID ) );
102102
float3 n = normalize( hit.normal );
103103

104-
int3 color;
104+
int3 color;
105105
color.x = ( ( n.x + 1.0f ) * 0.5f ) * 255;
106106
color.y = ( ( n.y + 1.0f ) * 0.5f ) * 255;
107107
color.z = ( ( n.z + 1.0f ) * 0.5f ) * 255;

0 commit comments

Comments
 (0)