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

Method run

tutorials/verify/verify.cpp:1128–1170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1126 : VerifyApplication::Test(name,isa,VerifyApplication::TEST_SHOULD_PASS,false), sflags(sflags), quality(quality) {}
1127
1128 VerifyApplication::TestReturnValue run (VerifyApplication* state, bool silent)
1129 {
1130 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa);
1131 RTCDeviceRef device = rtcNewDevice(cfg.c_str());
1132 errorHandler(nullptr,rtcGetDeviceError(device));
1133 rtcSetDeviceErrorFunction(device,errorHandler,nullptr);
1134
1135 std::vector<Vec3f> p;
1136 p.reserve(4);
1137 p.push_back(Vec3f(0.0f, 0.0f, 0.0f));
1138 p.push_back(Vec3f(1.0f, 0.0f, 0.0f));
1139 p.push_back(Vec3f(0.0f, 0.5f, 1.0f));
1140
1141 std::vector<uint32_t> indices;
1142 indices.push_back(0);
1143 indices.push_back(1);
1144 indices.push_back(2);
1145
1146 const size_t numTriangles = 1;
1147 const size_t numVertices = 3;
1148
1149 for (size_t i = 0; i < 1024*1024; ++i)
1150 {
1151 //rtcSetDeviceProperty(nullptr,(RTCDeviceProperty) 1000000, i);
1152
1153 RTCScene scene = rtcNewScene(device);
1154 rtcSetSceneFlags(scene,sflags.sflags);
1155 rtcSetSceneBuildQuality(scene,sflags.qflags);
1156
1157 RTCGeometry geom = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_TRIANGLE);
1158 rtcSetGeometryBuildQuality(geom,quality);
1159 rtcSetSharedGeometryBuffer(geom, RTC_BUFFER_TYPE_VERTEX, 0, RTC_FORMAT_FLOAT3, p.data(), 0, 3 * sizeof(float), numVertices);
1160 rtcSetSharedGeometryBuffer(geom, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3, indices.data(), 0, 3 * sizeof(uint32_t), numTriangles);
1161 rtcCommitGeometry(geom);
1162 rtcAttachGeometry(scene,geom);
1163 rtcReleaseGeometry(geom);
1164
1165 rtcCommitScene(scene);
1166 }
1167 AssertNoError(device);
1168
1169 return VerifyApplication::PASSED;
1170 }
1171 };
1172
1173 struct BuildTest : public VerifyApplication::Test

Callers

nothing calls this directly

Calls 15

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
rtcNewSceneFunction · 0.85
rtcSetSceneFlagsFunction · 0.85
rtcSetSceneBuildQualityFunction · 0.85
rtcCommitGeometryFunction · 0.85
rtcAttachGeometryFunction · 0.85

Tested by

no test coverage detected