提交 d1ad0d16 编写于 作者: M Matt Pharr

Fix crash with --wavefront integrator running on CPU.

Issue #170.
上级 b40ea102
......@@ -234,10 +234,13 @@ WavefrontPathIntegrator::WavefrontPathIntegrator(
// Allocate storage for all of the queues/buffers...
#ifdef PBRT_BUILD_GPU_RENDERER
CUDATrackedMemoryResource *mr =
dynamic_cast<CUDATrackedMemoryResource *>(memoryResource);
CHECK(mr);
size_t startSize = mr->BytesAllocated();
size_t startSize = 0;
if (Options->useGPU) {
CUDATrackedMemoryResource *mr =
dynamic_cast<CUDATrackedMemoryResource *>(memoryResource);
CHECK(mr);
startSize = mr->BytesAllocated();
}
#endif // PBRT_BUILD_GPU_RENDERER
// Compute number of scanlines to render per pass
......@@ -292,8 +295,13 @@ WavefrontPathIntegrator::WavefrontPathIntegrator(
stats = alloc.new_object<Stats>(maxDepth, alloc);
#ifdef PBRT_BUILD_GPU_RENDERER
size_t endSize = mr->BytesAllocated();
pathIntegratorBytes += endSize - startSize;
if (Options->useGPU) {
CUDATrackedMemoryResource *mr =
dynamic_cast<CUDATrackedMemoryResource *>(memoryResource);
CHECK(mr);
size_t endSize = mr->BytesAllocated();
pathIntegratorBytes += endSize - startSize;
}
#endif // PBRT_BUILD_GPU_RENDERER
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册