| 4924 | } |
| 4925 | |
| 4926 | void rtcore_regression_dynamic_thread(void* ptr) |
| 4927 | { |
| 4928 | ThreadRegressionTask* thread = (ThreadRegressionTask*) ptr; |
| 4929 | RegressionTask* task = thread->task; |
| 4930 | if (thread->threadIndex > 0) |
| 4931 | { |
| 4932 | for (unsigned int i=0; i<task->sceneCount; i++) |
| 4933 | { |
| 4934 | task->barrier.wait(); |
| 4935 | if (thread->threadIndex < task->numActiveThreads) |
| 4936 | { |
| 4937 | rtcJoinCommitScene(*task->scene); |
| 4938 | //if (rtcGetDeviceError(thread->device) != RTC_ERROR_NONE) task->errorCounter++;; |
| 4939 | if (rtcGetDeviceError(thread->device) != RTC_ERROR_NONE) { |
| 4940 | task->errorCounter++; |
| 4941 | } |
| 4942 | else { |
| 4943 | shootRandomRays(i,thread->intersectModes,thread->state->intersectVariants,*task->scene); |
| 4944 | } |
| 4945 | } |
| 4946 | task->barrier.wait(); |
| 4947 | } |
| 4948 | delete thread; thread = nullptr; |
| 4949 | return; |
| 4950 | } |
| 4951 | |
| 4952 | RTCBuildQuality build_quality = RTC_BUILD_QUALITY_LOW; |
| 4953 | if (RandomSampler_getInt(task->sampler)%2) build_quality = RTC_BUILD_QUALITY_MEDIUM; |
| 4954 | |
| 4955 | task->scene = new VerifyScene(thread->device,SceneFlags(RTC_SCENE_FLAG_DYNAMIC,build_quality)); |
| 4956 | if (rtcGetDeviceError(thread->device) != RTC_ERROR_NONE) task->errorCounter++;; |
| 4957 | if (task->cancelBuild) rtcSetSceneProgressMonitorFunction(*task->scene,monitorProgressFunction,nullptr); |
| 4958 | const size_t numSlots = 20; |
| 4959 | const size_t numIterations = 2*numSlots; |
| 4960 | std::pair<int,Ref<SceneGraph::Node>> geom[numSlots]; |
| 4961 | int types[numSlots]; |
| 4962 | RTCBuildQuality quality[numSlots]; |
| 4963 | Sphere spheres[numSlots]; |
| 4964 | size_t numVertices[numSlots]; |
| 4965 | for (size_t i=0; i<numSlots; i++) { |
| 4966 | geom[i].first = -1; |
| 4967 | geom[i].second = nullptr; |
| 4968 | types[i] = 0; |
| 4969 | numVertices[i] = 0; |
| 4970 | } |
| 4971 | |
| 4972 | bool hasError = false; |
| 4973 | |
| 4974 | for (unsigned int i=0; i<task->sceneCount; i++) |
| 4975 | { |
| 4976 | srand(task->sceneIndex*23565+i*2242); // FIXME: required? |
| 4977 | if (i%20 == 0) std::cout << "." << std::flush; |
| 4978 | |
| 4979 | for (unsigned int j=0; j<numIterations; j++) |
| 4980 | { |
| 4981 | int index = RandomSampler_getInt(task->sampler)%numSlots; |
| 4982 | if (geom[index].first == -1) |
| 4983 | { |
nothing calls this directly
no test coverage detected