mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.8k stars 429 forks source link

Address compile issue with macro expansion for using optixModuleCreate or optixModuleCreateFromPTX #332

Closed aclysma closed 1 year ago

aclysma commented 1 year ago

I didn't test this yet for both old/new version of optix, or anywhere but windows 10/VC 2019, but it does fix it for me locally. I can test more thoroughly later tonight.

Is #defining the function name fine or do you prefer avoiding that method?

aclysma commented 1 year ago

I validated this builds with optix 7.5.0 and 7.7.0.

The failing builds mostly look like a CI problem acquiring optix headers rather than an issue with the change itself.

pbrt4bounty commented 1 year ago

This patch works perfectly in my local repository. Tested on Windows, using MSVC 2022, CUDA 12.1 and Optix 7.7

mmp commented 1 year ago

Yeah, unfortunately github actions is often flaky about getting the environment set up before a run. In any case, thanks!