MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / mapTextureToSurface

Function mapTextureToSurface

Source/Falcor/Utils/CudaUtils.cpp:286–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286cudaSurfaceObject_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
306inline int32_t findDeviceByLUID(const std::vector<cudaDeviceProp>& devices, const AdapterLUID& luid)
307{

Callers 1

onLoadMethod · 0.85

Calls 1

Tested by

no test coverage detected