本文整理汇总了C++中osl::ShadingSystem::create_thread_info方法的典型用法代码示例。如果您正苦于以下问题:C++ ShadingSystem::create_thread_info方法的具体用法?C++ ShadingSystem::create_thread_info怎么用?C++ ShadingSystem::create_thread_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osl::ShadingSystem
的用法示例。
在下文中一共展示了ShadingSystem::create_thread_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: thread_init
CCL_NAMESPACE_BEGIN
/* Threads */
void OSLShader::thread_init(KernelGlobals *kg, KernelGlobals *kernel_globals, OSLGlobals *osl_globals)
{
/* no osl used? */
if(!osl_globals->use) {
kg->osl = NULL;
return;
}
/* per thread kernel data init*/
kg->osl = osl_globals;
kg->osl->services->thread_init(kernel_globals, osl_globals->ts);
OSL::ShadingSystem *ss = kg->osl->ss;
OSLThreadData *tdata = new OSLThreadData();
memset(&tdata->globals, 0, sizeof(OSL::ShaderGlobals));
tdata->globals.tracedata = &tdata->tracedata;
tdata->globals.flipHandedness = false;
tdata->osl_thread_info = ss->create_thread_info();
for(int i = 0; i < SHADER_CONTEXT_NUM; i++)
tdata->context[i] = ss->get_context(tdata->osl_thread_info);
tdata->oiio_thread_info = osl_globals->ts->get_perthread_info();
kg->osl_ss = (OSLShadingSystem*)ss;
kg->osl_tdata = tdata;
}
示例2:
ShadingContext::ShadingContext(
const Intersector& intersector,
Tracer& tracer,
TextureCache& texture_cache,
#ifdef WITH_OSL
OSL::ShadingSystem& shading_system,
#endif
ILightingEngine* lighting_engine,
const float transparency_threshold,
const size_t max_iterations)
: m_intersector(intersector)
, m_tracer(tracer)
, m_texture_cache(texture_cache)
, m_lighting_engine(lighting_engine)
, m_transparency_threshold(transparency_threshold)
, m_max_iterations(max_iterations)
#ifdef WITH_OSL
, m_osl_shading_system(shading_system)
, m_osl_thread_info(shading_system.create_thread_info())
, m_osl_shading_context(shading_system.get_context(m_osl_thread_info))
#endif
{
}
示例3:
OSLShaderGroupExec::OSLShaderGroupExec(OSL::ShadingSystem& shading_system)
: m_osl_shading_system(shading_system)
, m_osl_thread_info(shading_system.create_thread_info())
, m_osl_shading_context(shading_system.get_context(m_osl_thread_info))
{
}