ingowald / optix7course

Apache License 2.0
452 stars 80 forks source link

ex12_denoiseSeparateChannels fails on Optix 7.1 #9

Closed kyamant closed 3 years ago

kyamant commented 3 years ago

The example ex12_denoiseSeparateChannels on Optix 7.1 environment with:

[ 2][ ERROR]: Invalid value for OptixDenoiserOptions::inputKind: 0 Optix call (optixDenoiserCreate(optixContext,&denoiserOptions,&denoiser)) failed with code 7001 (line 764)

The following piece of code is where the problem is encountered:

void SampleRenderer::resize(const vec2i &newSize)
  {
    if (denoiser) {
      OPTIX_CHECK(optixDenoiserDestroy(denoiser));
    };

    // ------------------------------------------------------------------
    // create the denoiser:
    OptixDenoiserOptions denoiserOptions  {};
#if OPTIX_VERSION < 70100
    // these only exist in 7.0, not 7.1
    denoiserOptions.inputKind   = OPTIX_DENOISER_INPUT_RGB;
    denoiserOptions.pixelFormat = OPTIX_PIXEL_FORMAT_FLOAT4;
#endif

    OPTIX_CHECK(optixDenoiserCreate(optixContext,&denoiserOptions,&denoiser));
...
ingowald commented 3 years ago

closing this - latest version compiles on 7.1, 7.2, and 7.3