| 2308 | } |
| 2309 | |
| 2310 | VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent) |
| 2311 | { |
| 2312 | std::string cfg = state->rtcore + ",isa="+stringOfISA(isa); |
| 2313 | RTCDeviceRef device = rtcNewDevice(cfg.c_str()); |
| 2314 | errorHandler(nullptr,rtcGetDeviceError(device)); |
| 2315 | |
| 2316 | size_t M = 16*N+16; // pads the arrays with some valid data |
| 2317 | |
| 2318 | RTCGeometry geom = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_GRID); |
| 2319 | AssertNoError(device); |
| 2320 | |
| 2321 | interpolation_grids[0].startVertexID = 0; |
| 2322 | interpolation_grids[0].stride = 4; |
| 2323 | interpolation_grids[0].width = 4; |
| 2324 | interpolation_grids[0].height = 4; |
| 2325 | rtcSetSharedGeometryBuffer(geom, RTC_BUFFER_TYPE_GRID, 0, RTC_FORMAT_GRID, interpolation_grids, 0, sizeof(RTCGrid), 1); |
| 2326 | AssertNoError(device); |
| 2327 | |
| 2328 | std::vector<float> vertices0(M); |
| 2329 | for (size_t y=0; y<4; y++) |
| 2330 | for (size_t x=0; x<4; x++) |
| 2331 | for (size_t i=0; i<N; i++) |
| 2332 | vertices0[(y*4+x)*N+i] = (2.0f*float(x)/3.0f + 3.0f*y/3.0f)+float(i); |
| 2333 | |
| 2334 | rtcSetSharedGeometryBuffer(geom, RTC_BUFFER_TYPE_VERTEX, 0, RTC_FORMAT_FLOAT3, vertices0.data(), 0, N*sizeof(float), 4*4); |
| 2335 | AssertNoError(device); |
| 2336 | |
| 2337 | rtcCommitGeometry(geom); |
| 2338 | AssertNoError(device); |
| 2339 | |
| 2340 | bool passed = true; |
| 2341 | passed &= checkGridInterpolation(geom,RTC_BUFFER_TYPE_VERTEX,0,N); |
| 2342 | rtcReleaseGeometry(geom); |
| 2343 | AssertNoError(device); |
| 2344 | |
| 2345 | return (VerifyApplication::TestReturnValue) passed; |
| 2346 | } |
| 2347 | }; |
| 2348 | |
| 2349 | const size_t num_interpolation_hair_vertices = 13; |
nothing calls this directly
no test coverage detected