clBuildProgram(program, 0, null, "-cl-mad-enable", null, null);
kernel = clCreateKernel(program, "path_trace", null);
sampleBuffer = clCreateBuffer(context, CL_MEM_READ_WRITE,
3 * bufferWidth * bufferHeight * Sizeof.cl_float, null, null);
Scene scene = new Scene();
world.setDimension(0);
scene.loadChunks(this, world, chunks);
octree = scene.getOctree();
origin.set(scene.calcCenterCamera());
origin.sub(scene.getOrigin());
int[] octreeData = octree.toDataBuffer();
logger.info("octree size: " + (4 * octreeData.length) + " bytes");
octreeBuffer = clCreateBuffer(context, CL_MEM_READ_ONLY,
octreeData.length * Sizeof.cl_uint, null, null);
clEnqueueWriteBuffer(commandQueue, octreeBuffer, CL_TRUE, 0,