diff --git a/src/liboslexec/backendllvm.cpp b/src/liboslexec/backendllvm.cpp index 50907ea48..4ec18c49c 100644 --- a/src/liboslexec/backendllvm.cpp +++ b/src/liboslexec/backendllvm.cpp @@ -27,7 +27,7 @@ BackendLLVM::BackendLLVM(ShadingSystemImpl& shadingsys, ShaderGroup& group, , m_stat_llvm_opt_time(0) , m_stat_llvm_jit_time(0) { - m_use_optix = shadingsys.renderer()->supports("OptiX"); + m_use_optix = shadingsys.use_optix(); m_use_rs_bitcode = !shadingsys.m_rs_bitcode.empty(); m_name_llvm_syms = shadingsys.m_llvm_output_bitcode; diff --git a/src/liboslexec/oslexec_pvt.h b/src/liboslexec/oslexec_pvt.h index 7a657f2db..297b4b6f6 100644 --- a/src/liboslexec/oslexec_pvt.h +++ b/src/liboslexec/oslexec_pvt.h @@ -639,6 +639,7 @@ class ShadingSystemImpl { /// TextureSystem* texturesys() const { return m_texturesys; } + bool use_optix() const { return m_use_optix; } bool debug_nan() const { return m_debugnan; } bool debug_uninit() const { return m_debug_uninit; } bool lockgeom_default() const { return m_lockgeom_default; } @@ -924,6 +925,7 @@ class ShadingSystemImpl { std::vector m_symlocs; int m_max_local_mem_KB; ///< Local storage can a shader use int m_compile_report; ///< Print compilation report? + bool m_use_optix; ///< This is an OptiX-based renderer bool m_buffer_printf; ///< Buffer/batch printf output? bool m_no_noise; ///< Substitute trivial noise calls bool m_no_pointcloud; ///< Substitute trivial pointcloud calls diff --git a/src/liboslexec/shadingsys.cpp b/src/liboslexec/shadingsys.cpp index 7e1bd126b..b22e88821 100644 --- a/src/liboslexec/shadingsys.cpp +++ b/src/liboslexec/shadingsys.cpp @@ -1051,6 +1051,7 @@ ShadingSystemImpl::ShadingSystemImpl(RendererServices* renderer, , m_llvm_dumpasm(0) , m_max_local_mem_KB(2048) , m_compile_report(0) + , m_use_optix(renderer->supports("OptiX")) , m_buffer_printf(true) , m_no_noise(false) , m_no_pointcloud(false)