| 284 | } |
| 285 | |
| 286 | cudaSurfaceObject_t mapTextureToSurface(ref<Texture> pTex, uint32_t cudaUsageFlags) |
| 287 | { |
| 288 | // Create a mipmapped array from the texture |
| 289 | cudaMipmappedArray_t mipmap = importTextureToMipmappedArray(pTex, cudaUsageFlags); |
| 290 | |
| 291 | // Grab level 0 |
| 292 | cudaArray_t cudaArray; |
| 293 | FALCOR_CUDA_CHECK(cudaGetMipmappedArrayLevel(&cudaArray, mipmap, 0)); |
| 294 | |
| 295 | // Create cudaSurfObject_t from CUDA array |
| 296 | cudaResourceDesc resDesc; |
| 297 | memset(&resDesc, 0, sizeof(resDesc)); |
| 298 | resDesc.res.array.array = cudaArray; |
| 299 | resDesc.resType = cudaResourceTypeArray; |
| 300 | |
| 301 | cudaSurfaceObject_t surface; |
| 302 | FALCOR_CUDA_CHECK(cudaCreateSurfaceObject(&surface, &resDesc)); |
| 303 | return surface; |
| 304 | } |
| 305 | |
| 306 | inline int32_t findDeviceByLUID(const std::vector<cudaDeviceProp>& devices, const AdapterLUID& luid) |
| 307 | { |
no test coverage detected