//============================================================================= int parsercmd::cmdNE::execute() { TELL_DEBUG(cmdNE); if (NUMBER_TYPE(OPstack.top()->get_type())) OPstack.push(new telldata::ttbool(getOpValue() != getOpValue())); // else if (tn_ // box & poly equal return EXEC_NEXT; }
//============================================================================= bool parsercmd::cmdRETURN::checkRetype(telldata::argumentID* arg) { if (NULL == arg) return (_retype == telldata::tn_void); if (TLUNKNOWN_TYPE((*arg)())) { const telldata::tell_type* vartype; if (TLISALIST(_retype)) { // we have a list lval vartype = CMDBlock->getTypeByID(_retype & ~telldata::tn_listmask); if (NULL != vartype) vartype->userStructListCheck(arg); else arg->toList(); } else { // we have a struct only vartype = CMDBlock->getTypeByID(_retype); if (NULL != vartype) vartype->userStructCheck(arg); } } return ((_retype == (*arg)()) || (NUMBER_TYPE(_retype) && NUMBER_TYPE((*arg)()))); }
RenderPassDesc Driver::getRenderPassDesc() { auto desc = RenderPassDesc {}; auto cb_target_mask = getRegister<latte::CB_TARGET_MASK>(latte::Register::CB_TARGET_MASK); for (auto i = 0u; i < latte::MaxRenderTargets; ++i) { auto targetMask = (cb_target_mask.value >> (i * 4)) & 0xF; auto cb_color_base = getRegister<latte::CB_COLORN_BASE>(latte::Register::CB_COLOR0_BASE + i * 4); auto cb_color_info = getRegister<latte::CB_COLORN_INFO>(latte::Register::CB_COLOR0_INFO + i * 4); if (!!targetMask && cb_color_base.BASE_256B() != 0) { desc.colorTargets[i] = RenderPassDesc::ColorTarget { true, cb_color_info.FORMAT(), cb_color_info.NUMBER_TYPE(), 1 }; } else { desc.colorTargets[i] = RenderPassDesc::ColorTarget { false, latte::CB_FORMAT::COLOR_INVALID, latte::CB_NUMBER_TYPE::UNORM, 0 }; } } auto db_depth_control = getRegister<latte::DB_DEPTH_CONTROL>(latte::Register::DB_DEPTH_CONTROL); auto zEnable = db_depth_control.Z_ENABLE(); auto stencilEnable = db_depth_control.STENCIL_ENABLE(); auto depthEnabled = zEnable || stencilEnable; auto db_depth_base = getRegister<latte::DB_DEPTH_BASE>(latte::Register::DB_DEPTH_BASE); auto db_depth_info = getRegister<latte::DB_DEPTH_INFO>(latte::Register::DB_DEPTH_INFO); if (depthEnabled && db_depth_base.BASE_256B() != 0) { desc.depthTarget = RenderPassDesc::DepthStencilTarget { true, db_depth_info.FORMAT() }; } else { desc.depthTarget = { false, latte::DB_FORMAT::DEPTH_INVALID }; } return desc; }
void telldata::argumentID::userStructCheck(const telldata::tell_type& vartype, bool cmdUpdate) { const telldata::recfieldsID& recfields = vartype.fields(); // first check that both lists have the same size if (_child.size() != recfields.size()) return; recfieldsID::const_iterator CF; argumentQ::iterator CA; for (CF = recfields.begin(), CA = _child.begin(); (CF != recfields.end() && CA != _child.end()); CF ++, CA++) { if ( TLUNKNOWN_TYPE( (**CA)() ) ) if (TLISALIST(CF->second)) {// check the list fields if (TLCOMPOSIT_TYPE((CF->second) & ~telldata::tn_listmask)) (*CA)->userStructListCheck(*(vartype.findtype(CF->second)), cmdUpdate); else (*CA)->toList(cmdUpdate); } else // call in recursion the userStructCheck method of the child (*CA)->userStructCheck(*(vartype.findtype(CF->second)), cmdUpdate); if (!NUMBER_TYPE( CF->second )) { // for non-number types there is no internal conversion, // so check strictly the type if ( (**CA)() != CF->second) return; // no match } else // for number types - allow compatablity (int to real only) if (!NUMBER_TYPE( (**CA)() )) return; // no match else if (CF->second < (**CA)() ) return; // no match } // all fields match => we can assign a known ID to the argumentID _ID = vartype.ID(); if (cmdUpdate) static_cast<parsercmd::cmdSTRUCT*>(_command)->setargID(this); }