Skip to content

Commit

Permalink
Fix consistent PTX order with OptiX configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Speierers committed Dec 14, 2022
1 parent 2ff5dd4 commit 187da96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/render/scene_optix.inl
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,16 @@ size_t init_optix_config(bool has_meshes, bool has_others, bool has_instances) {
config.program_groups
));

// Create this variable in the JIT scope 0 to ensure a consistent
// ordering in the generated PTX kernel (e.g. for other scenes).
uint32_t scope = jit_scope(JitBackend::CUDA);
jit_set_scope(JitBackend::CUDA, 0);
config.pipeline_jit_index = jit_optix_configure_pipeline(
&config.pipeline_compile_options,
config.module,
config.program_groups, PROGRAM_GROUP_COUNT
);
jit_set_scope(JitBackend::CUDA, scope);
}

return config_index;
Expand Down

0 comments on commit 187da96

Please sign in to comment.