Skip to content

Commit

Permalink
Give ShadingSystemImpl a handy use_optix() method (#1682)
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed May 11, 2023
1 parent 374543f commit abdc966
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/liboslexec/backendllvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions src/liboslexec/oslexec_pvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -924,6 +925,7 @@ class ShadingSystemImpl {
std::vector<SymLocationDesc> 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
Expand Down
1 change: 1 addition & 0 deletions src/liboslexec/shadingsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit abdc966

Please sign in to comment.