/* API INITIALIZATION */
int cpuidx = -1;
for (int idx = 0; idx < IntersectionApi::GetIntersectionDeviceCount(); ++idx) {
IntersectionDeviceInfo const& devinfo(IntersectionApi::GetIntersectionDeviceInfo(idx));
if (devinfo.type == IntersectionDeviceInfo::kCpu && devinfo.apis & IntersectionDeviceInfo::kOpenCl) {
gpuidx = idx;
}
}
int apitype = IntersectionDeviceInfo::kOpenCl;
scene = IntersectionApi::Create(0, &cpuidx, &apitype, 1);
/* SETTING UP SCENE */
Shape *shape = scene->CreateMesh(&vertex[0].x, numVert, sizeof(vec4), &v->at(0), sizeof(int) * 3, nullptr, numTri/3);
scene->AttachShape(shape);
scene->Commit()
raysCPU = (ray*)malloc(sizeof(ray)*rayBufferRayCount);
hitsCPU = (Intersection*)malloc(sizeof(Intersection)*rayBufferRayCount);
m_Rays->getData(0, rayBufferRayCount * sizeof(ray), raysCPU);
scene->IntersectBatch(raysCPU, rayBufferRayCount, hitsCPU);
m_Hits->setData(rayBufferRayCount*sizeof(Intersection), hitsCPU);
Question:
The code above is the way i set up my device, my goal is run the IntersectionBatch() at CPU.
m_Rays() gets the rays from my openGl application and store them in a Ray vector.
m_Hits() sends the hits vector to my OpenGl application.
I followed all your instructions that you gave me at FireraysSDK web page, but the problem is the IntersectionBatch function is getting me "unhandled exception", can you help me with this?
Output Window:
Exception thrown at 0x00007FFE94171F08 in composerOptix64_d.exe: Microsoft C++ exception: FireRays::ExceptionImpl at memory location 0x000000000013CF58.
Exception thrown at 0x00007FFE94171F08 in composerOptix64_d.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFE94171F08 in composerOptix64_d.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFE94171F08 in composerOptix64_d.exe: Microsoft C++ exception: FireRays::ExceptionImpl at memory location 0x000000000013CF58.