MCPcopy Create free account
hub / github.com/RenderKit/embree / run

Method run

tutorials/verify/verify.cpp:3253–3443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3251 }
3252
3253 VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent)
3254 {
3255 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa);
3256 RTCDeviceRef device = rtcNewDevice(cfg.c_str());
3257 errorHandler(nullptr,rtcGetDeviceError(device));
3258
3259 Ref<SceneGraph::Node> sphere = SceneGraph::createQuadSphere(Vec3fa(0.f), 1.f, 32);
3260
3261 sflags.sflags = sflags.sflags | RTC_SCENE_FLAG_FILTER_FUNCTION_IN_ARGUMENTS;
3262
3263 VerifyScene bl_scene(device, sflags);
3264 bl_scene.addGeometry(quality, sphere);
3265 rtcCommitScene(bl_scene);
3266 AssertNoError(device);
3267
3268 size_t num_runs = 1; //(size_t)state->intensity;
3269
3270 bool passed = true;
3271
3272 for (size_t num_time_steps = 1; num_time_steps < 4; ++num_time_steps) {
3273 for (size_t run = 0; run < num_runs; ++run)
3274 {
3275 size_t numTransforms = 32 + 1024 * random_float();
3276
3277 std::vector<std::vector<T>> transforms(num_time_steps);
3278 for (int t = 0; t < num_time_steps; ++t) {
3279 transforms[t] = std::vector<T>(numTransforms);
3280 for (int i = 0; i < numTransforms; ++i) {
3281 transforms[t][i] = getRandomTransform<T>(this);
3282 }
3283 }
3284
3285 float time_range_min = 0.f; //0.0f + 0.5f * random_float();
3286 float time_range_max = 1.f; //0.5f + 0.5f * random_float();
3287
3288 RTCScene tl_instance_array_scene = rtcNewScene(device);
3289 RTCGeometry instance_array = rtcNewGeometry (device, RTC_GEOMETRY_TYPE_INSTANCE_ARRAY);
3290 rtcSetGeometryTimeStepCount(instance_array, num_time_steps);
3291 rtcSetGeometryTimeRange(instance_array, time_range_min, time_range_max);
3292 for (int t = 0; t < num_time_steps; ++t) {
3293 if (std::is_same<T, AffineSpace3fa>()) {
3294 rtcSetSharedGeometryBuffer(instance_array, RTC_BUFFER_TYPE_TRANSFORM, t, RTC_FORMAT_FLOAT4X4_COLUMN_MAJOR, (void*)&transforms[t][0], 0, sizeof(T), numTransforms);
3295 } else if (std::is_same<T, AffineSpace3f>()) {
3296 rtcSetSharedGeometryBuffer(instance_array, RTC_BUFFER_TYPE_TRANSFORM, t, RTC_FORMAT_FLOAT3X4_COLUMN_MAJOR, (void*)&transforms[t][0], 0, sizeof(T), numTransforms);
3297 } else if (std::is_same<T, RTCQuaternionDecomposition>()) {
3298 rtcSetSharedGeometryBuffer(instance_array, RTC_BUFFER_TYPE_TRANSFORM, t, RTC_FORMAT_QUATERNION_DECOMPOSITION, (void*)&transforms[t][0], 0, sizeof(T), numTransforms);
3299 }
3300 }
3301 rtcSetGeometryInstancedScene(instance_array, bl_scene);
3302 rtcAttachGeometry(tl_instance_array_scene,instance_array);
3303 rtcReleaseGeometry(instance_array);
3304 rtcCommitGeometry(instance_array);
3305 rtcCommitScene(tl_instance_array_scene);
3306 AssertNoError(device);
3307
3308 RTCScene tl_instance_scene = rtcNewScene(device);
3309 for (size_t i = 0; i < numTransforms; ++i) {
3310 RTCGeometry instance = rtcNewGeometry (device, RTC_GEOMETRY_TYPE_INSTANCE);

Callers

nothing calls this directly

Calls 15

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
rtcCommitSceneFunction · 0.85
AssertNoErrorFunction · 0.85
rtcNewSceneFunction · 0.85
rtcSetGeometryTimeRangeFunction · 0.85
rtcAttachGeometryFunction · 0.85

Tested by

no test coverage detected