rnd-team-dev / plotoptix

Data visualisation and ray tracing in Python based on OptiX 7.7 framework.
https://rnd.team/plotoptix
Other
498 stars 25 forks source link

Adding a mesh after calling rt.start() not working #24

Closed dralois closed 3 years ago

dralois commented 3 years ago

If the raytracing loop is started after adding a mesh everything works as expected, if the first mesh is added after calling start() the following error is raised:

OPTIX_ERROR_INVALID_VALUE: Optix call 'optixPipelineCreate( state.context, &state.modules.pipelineCompileOptions(), &pipeline_link_options, program_groups.data(), program_groups.size(), log, &sizeof_log, &state.pipeline )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\pathtracer.cpp:2721) Log: COMPILE ERROR: pipeline compile option usesPrimitiveTypeFlags for "programGroups[0].raygen.module" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[1].miss.module" does not match value from pipeline creation Info: Pipeline has 4 module(s), 4 entry function(s), 3 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 143 basic block(s) in entry functions, 2343 instruction(s) in entry functions, 0 non-entry function(s), 0 basic block(s) in non-entry functions, 0 instruction(s) in non-entry functions

If a mesh is added first before calling start(), the next mesh that is added does not raise this error. This only occurs if the scene is empty when starting the loop. I assume this is a bug and not intended?

dralois commented 3 years ago

Also a follow-up issue: If a mesh is added before and deleted after starting the loop, a similar error is raised. This stops if another mesh is added after the deletion. The error is as follows:

OPTIX_ERROR_INVALID_VALUE: Optix call 'optixPipelineCreate( state.context, &state.modules.pipelineCompileOptions(), &pipeline_link_options, program_groups.data(), program_groups.size(), log, &sizeof_log, &state.pipeline )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\pathtracer.cpp:2721) Log: COMPILE ERROR: pipeline compile option usesPrimitiveTypeFlags for "programGroups[0].raygen.module" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[1].miss.module" does not match value from pipeline creation programGroups[3] argument is null

dralois commented 3 years ago

And one more (probably) related thing: If the first mesh is added after starting the loop and is then removed again, another slightly different error occurs:

OPTIX_ERROR_INVALID_VALUE: Optix call 'optixPipelineCreate( state.context, &state.modules.pipelineCompileOptions(), &pipeline_link_options, program_groups.data(), program_groups.size(), log, &sizeof_log, &state.pipeline )' failed: c:\users\sulej\documents\visual studio 2017\projects\optix\cppsharpoptix7\pathtracer.cpp:2721) Log: COMPILE ERROR: pipeline compile option usesPrimitiveTypeFlags for "programGroups[0].raygen.module" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[1].miss.module" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[3].hitgroup.moduleCH" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[3].hitgroup.moduleIS" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[4].hitgroup.moduleCH" does not match value from pipeline creation pipeline compile option usesPrimitiveTypeFlags for "programGroups[4].hitgroup.moduleIS" does not match value from pipeline creation Info: Pipeline has 4 module(s), 4 entry function(s), 3 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 120 basic block(s) in entry functions, 1805 instruction(s) in entry functions, 0 non-entry function(s), 0 basic block(s) in non-entry functions, 0 instruction(s) in non-entry functions

robertsulej commented 3 years ago

Thanks for reporting! I'll have a look at this today evening.

robertsulej commented 3 years ago

OK, fixed in Windows binaries. Will push linux update in a moment.

dralois commented 3 years ago

I just now got around to check out the fix, and everything seems to work as it should now. Thank you and I'm closing the issue!