1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../common/tutorial/tutorial_device.isph"
struct Sphere
{
ALIGNED_STRUCT_(16)
Vec3f p; //!< position of the sphere
float r; //!< radius of the sphere
unsigned int geomID;
unsigned int num_time_steps;
};
struct TutorialData
{
RTCScene g_scene;
uniform Vec3f face_colors[12];
uniform float g_time;
/* accumulation buffer */
uniform Vec3ff* uniform g_accu;
uniform unsigned int g_accu_width;
uniform unsigned int g_accu_height;
uniform unsigned int g_accu_count;
uniform Vec3fa g_accu_vx;
uniform Vec3fa g_accu_vy;
uniform Vec3fa g_accu_vz;
uniform Vec3fa g_accu_p;
RTCScene scene0;
RTCScene scene1;
RTCScene scene2;
RTCScene scene3;
uniform Sphere* uniform sphere0;
uniform Sphere* uniform sphere1;
};
inline void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_time = 0;
This->g_accu = NULL;
This->g_accu_width = 0;
This->g_accu_height = 0;
This->g_accu_count = 0;
This->g_accu_vx = make_Vec3fa(0.0f);
This->g_accu_vy = make_Vec3fa(0.0f);
This->g_accu_vz = make_Vec3fa(0.0f);
This->g_accu_p = make_Vec3fa(0.0f);
This->scene0 = NULL;
This->scene1 = NULL;
This->scene2 = NULL;
This->scene3 = NULL;
This->sphere0 = NULL;
This->sphere1 = NULL;
}
inline void TutorialData_Destructor(uniform TutorialData* uniform This)
{
delete This->sphere0; This->sphere0 = NULL;
delete This->sphere1; This->sphere1 = NULL;
rtcReleaseScene(This->scene0); This->scene0 = NULL;
rtcReleaseScene(This->scene1); This->scene1 = NULL;
rtcReleaseScene(This->scene2); This->scene2 = NULL;
rtcReleaseScene(This->scene3); This->scene3 = NULL;
rtcReleaseScene (This->g_scene); This->g_scene = NULL;
delete[] This->g_accu; This->g_accu = NULL;
This->g_accu_width = 0;
This->g_accu_height = 0;
This->g_accu_count = 0;
}
|