本文整理汇总了C++中Symbol::connected_down方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::connected_down方法的具体用法?C++ Symbol::connected_down怎么用?C++ Symbol::connected_down使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol::connected_down方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
void
ShaderInstance::copy_code_from_master (ShaderGroup &group)
{
ASSERT (m_instops.empty() && m_instargs.empty());
// reserve with enough room for a few insertions
m_instops.reserve (master()->m_ops.size()+10);
m_instargs.reserve (master()->m_args.size()+10);
m_instops = master()->m_ops;
m_instargs = master()->m_args;
// Copy the symbols from the master
ASSERT (m_instsymbols.size() == 0 &&
"should not have copied m_instsymbols yet");
m_instsymbols = m_master->m_symbols;
// Copy the instance override data
// Also set the renderer_output flags where needed.
ASSERT (m_instoverrides.size() == (size_t)std::max(0,lastparam()));
ASSERT (m_instsymbols.size() >= (size_t)std::max(0,lastparam()));
if (m_instoverrides.size()) {
for (size_t i = 0, e = lastparam(); i < e; ++i) {
Symbol *si = &m_instsymbols[i];
if (m_instoverrides[i].valuesource() == Symbol::DefaultVal) {
// Fix the length of any default-value variable length array
// parameters.
if (si->typespec().is_unsized_array())
si->arraylen (si->initializers());
} else {
if (m_instoverrides[i].arraylen())
si->arraylen (m_instoverrides[i].arraylen());
si->valuesource (m_instoverrides[i].valuesource());
si->connected_down (m_instoverrides[i].connected_down());
si->lockgeom (m_instoverrides[i].lockgeom());
si->dataoffset (m_instoverrides[i].dataoffset());
si->data (param_storage(i));
}
if (shadingsys().is_renderer_output (layername(), si->name(), &group)) {
si->renderer_output (true);
renderer_outputs (true);
}
}
}
evaluate_writes_globals_and_userdata_params ();
off_t symmem = vectorbytes(m_instsymbols) - vectorbytes(m_instoverrides);
SymOverrideInfoVec().swap (m_instoverrides); // free it
// adjust stats
{
spin_lock lock (shadingsys().m_stat_mutex);
shadingsys().m_stat_mem_inst_syms += symmem;
shadingsys().m_stat_mem_inst += symmem;
shadingsys().m_stat_memory += symmem;
}
}
示例2: lock
void
ShaderInstance::copy_code_from_master ()
{
ASSERT (m_instops.empty() && m_instargs.empty());
// reserve with enough room for a few insertions
m_instops.reserve (master()->m_ops.size()+10);
m_instargs.reserve (master()->m_args.size()+10);
m_instops = master()->m_ops;
m_instargs = master()->m_args;
// Copy the symbols from the master
ASSERT (m_instsymbols.size() == 0 &&
"should not have copied m_instsymbols yet");
m_instsymbols = m_master->m_symbols;
// Copy the instance override data
ASSERT (m_instoverrides.size() == (size_t)std::max(0,lastparam()));
ASSERT (m_instsymbols.size() >= (size_t)std::max(0,lastparam()));
if (m_instoverrides.size()) {
for (size_t i = 0, e = lastparam(); i < e; ++i) {
if (m_instoverrides[i].valuesource() != Symbol::DefaultVal) {
Symbol *si = &m_instsymbols[i];
si->data (param_storage(i));
si->valuesource (m_instoverrides[i].valuesource());
si->connected_down (m_instoverrides[i].connected_down());
si->lockgeom (m_instoverrides[i].lockgeom());
}
}
}
off_t symmem = vectorbytes(m_instsymbols) - vectorbytes(m_instoverrides);
SymOverrideInfoVec().swap (m_instoverrides); // free it
// adjust stats
{
spin_lock lock (shadingsys().m_stat_mutex);
shadingsys().m_stat_mem_inst_syms += symmem;
shadingsys().m_stat_mem_inst += symmem;
shadingsys().m_stat_memory += symmem;
}
}