• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Mark函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Mark函数的典型用法代码示例。如果您正苦于以下问题:C++ Mark函数的具体用法?C++ Mark怎么用?C++ Mark使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Mark函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: LockMem

void scContUnit::Iter( SubstituteFunc	func,
					   long				startLocation,
					   long&			limitOffset )
{
	UCS2			chBuf[64];
	UCS2*			chP;
	CharRecordP		startChRec;
	scSpecRecord*	specRec;
	long			startOffset,
					endOffset,
					wordLen;
	
	LockMem( startChRec, specRec );
	
	startOffset = startLocation;
	endOffset 	= startOffset;
	
	for ( ; endOffset < limitOffset; ) {
		startOffset = TXTStartSelectableWord( startChRec, endOffset );
		endOffset 	= TXTEndSelectableWord( startChRec, endOffset );
		wordLen = endOffset - startOffset;
		
		if ( wordLen > 1 ) {
			BuildTestWord( chBuf, startChRec + startOffset, wordLen );
			status stat = (*func)( &chP, chBuf, NULL );
			
			if ( stat == scSuccess || stat == scUserAbort ) {
				if ( !ReplaceWord( startChRec, specRec, startOffset, endOffset,
								   limitOffset, chBuf, chP ) ) {
						UnlockMem( );
						return;
				}
				
				fCharArray.RepairText( fSpecRun, startOffset, endOffset );
				Mark( scREBREAK );
				
				if ( stat == scUserAbort )
					goto exit;
			}
		}
		endOffset = FindNextSpellingWord( startChRec, endOffset, limitOffset );
	}

exit:
	UnlockMem( );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:46,代码来源:Scparag2.cpp


示例2: Mark

void GarbageCollector::PerformGC(RunTimeStack &s)
	{
	// Perform mark-and-sweep garbage collection.  We
	// follow every pointer in every activation record
	// in the RunTimeStack, marking all Objects found.
	// Before marking an Object, we make sure it is not
	// already marked, so we don't enter an infinite loop.

	// Then we sweep once through the ObjectList.  For
	// each Object in the ObjectList, if it is not marked,
	// we remove it from the list and delete it; otherwise,
	// we unmark it so it is ready for the next round of
	// mark-and-sweep.

	Mark(s);
	Sweep(s);
	}
开发者ID:bmajoros,项目名称:Epsilon,代码行数:17,代码来源:garbage.C


示例3: BMenu

ColorMenu::ColorMenu (const char *name, BView *_view, int h, int v, float s)
: BMenu (name, h*s, v*s)
{
	index = 0;
	for (int i = 0; i < v; i++)
		for (int j = 0; j < h; j++)
		{
			BRect cframe = BRect (j*s, i*s, (j + 1)*s, (i + 1)*s);
			AddItem (new ColorItem (system_colors()->color_list[index]), cframe);
		}
	Mark (0);
	view = _view;
	hs = h*s;
	vs = v*s;
	parent = NULL;
	fWindow = NULL;
}
开发者ID:gedrin,项目名称:Becasso,代码行数:17,代码来源:ColorMenu.cpp


示例4: PREFIX_ASSUME

//*****************************************************************************
// cascading Mark of a CustomAttribute
//*****************************************************************************
HRESULT FilterManager::MarkCustomAttribute(mdCustomAttribute cv)
{
    HRESULT     hr = NOERROR;
    CustomAttributeRec *pRec;

    // We know that the filter table is not null here.  Tell PREFIX that we know it.
    PREFIX_ASSUME(m_pMiniMd->GetFilterTable() != NULL);

    IfFailGo( m_pMiniMd->GetFilterTable()->MarkCustomAttribute( cv ) );

    // Mark the type (and any family) of the CustomAttribue.
    IfFailGo(m_pMiniMd->GetCustomAttributeRecord(RidFromToken(cv), &pRec));
    IfFailGo( Mark(m_pMiniMd->getTypeOfCustomAttribute(pRec)) );

ErrExit:
    return hr;
} // HRESULT FilterManager::MarkCustomAttribute()
开发者ID:Afshintm,项目名称:coreclr,代码行数:20,代码来源:filtermanager.cpp


示例5: assignAttVar

void
assignAttVar(Word av, Word value, int flags ARG_LD)
{ Word a;
  mark m;

  assert(isAttVar(*av));
  assert(!isRef(*value));
  assert(gTop+8 <= gMax && tTop+6 <= tMax);
  DEBUG(CHK_SECURE, assert(on_attvar_chain(av)));

  DEBUG(1, Sdprintf("assignAttVar(%s)\n", vName(av)));

  if ( isAttVar(*value) )
  { if ( value > av )
    { Word tmp = av;
      av = value;
      value = tmp;
    } else if ( av == value )
      return;
  }

  if( !(flags & ATT_ASSIGNONLY) )
  { a = valPAttVar(*av);
    registerWakeup(av, a, value PASS_LD);
  }

  if ( (flags&ATT_WAKEBINDS) )
    return;

  Mark(m);		/* must be trailed, even if above last choice */
  LD->mark_bar = NO_MARK_BAR;
  TrailAssignment(av);
  DiscardMark(m);

  if ( isAttVar(*value) )
  { DEBUG(1, Sdprintf("Unifying two attvars\n"));
    *av = makeRef(value);
  } else if ( isVar(*value) )
  { DEBUG(1, Sdprintf("Assigning attvar with plain var\n"));
    *av = makeRef(value);			/* JW: Does this happen? */
  } else
    *av = *value;

  return;
}
开发者ID:DouglasRMiles,项目名称:swipl-devel,代码行数:45,代码来源:pl-attvar.c


示例6: tlacitkem

int CGUIListItem::MouseLeft(float x, float y, UINT mouseState, UINT keyState)
{		// kliknuti levym tlacitkem (mouseState 0 = pusteni, 1 = stisknuti cudlitka)

	if(mouseState)
	{
		if(listBox->markListItem==this)
		{
			OnClick();
			EventArise(EClicked);
		}
		else
		{
			Mark();
		}
	}

	return 0;
}
开发者ID:HonzaMD,项目名称:Krkal2,代码行数:18,代码来源:list.cpp


示例7: MarkAll

void Registry::GarbageCollect()
{
	// unmark all objects
	MarkAll(false);

	// mark everything that is reachable from the root
	Mark(root, true);

	// everything that is not now marked is not reachable and can be deleted
	deathrow.clear();
	foreach (Instances::value_type const &val, instances)
	{
		StorageBase const *base = val.second;
		if (!base->IsMarked())
		{
			//OM_TRACE_1(4, base->GetHandle().value) << " adding to deathrow";
			deathrow.push_back(base->GetHandle());
		}
	}
开发者ID:koden-km,项目名称:ObjectModel,代码行数:19,代码来源:Registry.cpp


示例8: UpdateProductItem

void CProductCheckListBoxItem::UpdateProductItem(void)
{
	if (Mark())
	{
		m_pItem->SetFlag(PRODUCT_ITEM_Marked);
	}
	else
	{
		m_pItem->ClearFlag(PRODUCT_ITEM_Marked);
	}
	
	if (Select())
	{
		m_pItem->SetFlag(PRODUCT_ITEM_Selected);
	}
	else
	{
		m_pItem->ClearFlag(PRODUCT_ITEM_Selected);
	}
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:20,代码来源:CHECKLB.CPP


示例9: QueryExtents

/* ==================================================================== */
void scTextline::MarkForDeletion( void )
{
	scXRect xrect = QueryExtents( xrect, 1 );
	
	if ( fPara && fPara->GetFirstline() == this )
		fPara->SetFirstline( 0 );

		// de-normalize extents
	if ( fColumn->GetFlowdir().IsVertical() )
		xrect.Translate( fVJOffset, 0 );	
	else								
		xrect.Translate( 0, -fVJOffset );
	
	fInkExtents 	= xrect;
	fPara			= 0; 
	fLineCount		= -1;
	fStartOffset	= -1;
	fEndOffset		= -1;
	Mark( scINVALID );
}	
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:21,代码来源:Sctextli.cpp


示例10: find_levels_r

static void
find_levels_r(struct block *b)
{
	int level;

	if (isMarked(b))
		return;

	Mark(b);
	b->link = 0;

	if (JT(b)) {
		find_levels_r(JT(b));
		find_levels_r(JF(b));
		level = MAX(JT(b)->level, JF(b)->level) + 1;
	} else
		level = 0;
	b->level = level;
	b->link = levels[level];
	levels[level] = b;
}
开发者ID:enukane,项目名称:netbsd-src,代码行数:21,代码来源:optimize.c


示例11: IfFailGo

//*****************************************************************************
// cascading Mark of all GenericPar associated with a TypeDef or MethodDef token
//*****************************************************************************
HRESULT FilterManager::MarkGenericParamWithParentToken(
    mdToken     tk)
{
    HRESULT     hr = NOERROR;
    RID         ulStart, ulEnd;
    RID         index;
    GenericParamRec *pGenericParamRec;
    mdToken     constraint;
    HENUMInternal hEnum;                // To enumerate constraints.

    // Enumerate the GenericPar
    //@todo: Handle the unsorted case.
    IfFailGo( m_pMiniMd->GetGenericParamsForToken(tk, &ulStart, &ulEnd) );

    for (; ulStart < ulEnd; ++ulStart)
    {
        index = m_pMiniMd->GetGenericParamRid(ulStart);
        IfFailGo(m_pMiniMd->GetGenericParamRecord(index, &pGenericParamRec));

        RID ridConstraint;
        IfFailGo( m_pMiniMd->FindGenericParamConstraintHelper(TokenFromRid(ulStart, mdtGenericParam), &hEnum) );
        while (HENUMInternal::EnumNext(&hEnum, (mdToken *) &ridConstraint))
        {
            // Get the constraint.
            GenericParamConstraintRec *pRec;
            IfFailGo(m_pMiniMd->GetGenericParamConstraintRecord(RidFromToken(ridConstraint), &pRec));
            constraint = m_pMiniMd->getConstraintOfGenericParamConstraint(pRec);

            // Mark it.
            IfFailGo( Mark(constraint) );
        }
        HENUMInternal::ClearEnum(&hEnum);
    }

ErrExit:
    HENUMInternal::ClearEnum(&hEnum);

    return hr;
} // HRESULT FilterManager::MarkGenericParamWithParentToken()
开发者ID:Afshintm,项目名称:coreclr,代码行数:42,代码来源:filtermanager.cpp


示例12: AllocRubiArray

void scContUnit::ApplyAnnotation( long			start,
								  long			end,
								  const scAnnotation&	annot )
{
	eChTranType	chTranType	= eNormalTran;
	
	if ( !fRubiArray ) {
		AllocRubiArray();
	}
	else if ( fRubiArray->IsRubiData( start, end ) ) {
		int			nth;
		int			index;
		scRubiData	rd;	
		
		fCharArray.Transform( start, end, eRemoveJapTran, end - start );
		for ( nth = 1; fRubiArray->GetNthRubi( index, rd, nth, start, end );  )
			fRubiArray->RemoveDataAt( index );
	}
	
	if ( annot.fAnnotate ) {
		scRubiData rd( annot.fCharStr, start, end, SpecAtOffset( start + 1 ) );
	
		fRubiArray->AddRubiData( rd );
		
		chTranType = eRubiTran;
	}
	else {
			// i should have already removed any annotations
		if ( fRubiArray->GetNumItems() == 0 )
			DeleteRubiArray();
		chTranType = eRemoveJapTran;
	}
	Mark( scREBREAK );
	ForceRepaint( start, end );	
	fCharArray.Transform( start, end, chTranType, end - start );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:36,代码来源:Scparag2.cpp


示例13: GetStencil

void StencilComp::Write (ostream& out) {
    GraphicComp::Write(out);
    UStencil* stencil = GetStencil();
    Bitmap* image, *mask;
    stencil->GetOriginal(image, mask);

    WriteBitmap(image, out);
    Mark(out);

    if (mask == nil) {
        out << no_mask;
    } else if (mask == image) {
        out << mask_equals_image;
    } else {
        out << valid_mask;
        WriteBitmap(mask, out);
    }

    WriteBgFilled(stencil->BgFilled(), out);
    WriteColor(stencil->GetFgColor(), out);
    WriteColor(stencil->GetBgColor(), out);
    WriteTransformer(stencil->GetTransformer(), out);
    WriteString(_filename, out);
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:24,代码来源:stencilcomp.cpp


示例14: make_pair

list<class Mark> Mark::RewriteWithSimpleTokens () {
  list<Mark> ret;
  // example : <{1,2},{a,b,c},{x}> -> <{2},{c},{x}> + <{2},{b},{x}> + <{2},{a},{x}> +  <{1},{c},{x}> + <{1},{b},{x}> + <{1},{a},{x}> 
  
  list<pair <int,int> > pos;
  for (list<vector<Element> >::iterator it = elts.begin() ; it != elts.end() ; it++) {
    pos.push_back( make_pair(0,it->size()) ); 
  }  
  
  list< pair<int,int> >::iterator pit;
  list<vector<Element> >::iterator cit;
  do {
    list<vector<Element> > forret;
    
    for (pit = pos.begin(),cit = elts.begin() ; pit != pos.end() ;pit++,cit++) {
      forret.push_back(vector<Element> (1,(*cit)[pit->first]));
    }
    ret.push_back ( Mark(dom,forret,mult));
  } while (! calcSub::next(pos) );

  
  return ret;

}
开发者ID:cosyverif,项目名称:deb-libsnow,代码行数:24,代码来源:Mark.cpp


示例15: Pos

cSkinDisplayReplay::cProgressBar::cProgressBar(int Width, int Height, int Current, int Total, const cMarks *Marks, tColor ColorSeen, tColor ColorRest, tColor ColorSelected, tColor ColorMark, tColor ColorCurrent)
:cBitmap(Width, Height, 2)
{
  total = Total;
  if (total > 0) {
     int p = Pos(Current);
     DrawRectangle(0, 0, p, Height - 1, ColorSeen);
     DrawRectangle(p + 1, 0, Width - 1, Height - 1, ColorRest);
     if (Marks) {
        bool Start = true;
        for (const cMark *m = Marks->First(); m; m = Marks->Next(m)) {
            int p1 = Pos(m->position);
            if (Start) {
               const cMark *m2 = Marks->Next(m);
               int p2 = Pos(m2 ? m2->position : total);
               int h = Height / 3;
               DrawRectangle(p1, h, p2, Height - h, ColorSelected);
               }
            Mark(p1, Start, m->position == Current, ColorMark, ColorCurrent);
            Start = !Start;
            }
        }
     }
}
开发者ID:Moorviper,项目名称:zen2vdr,代码行数:24,代码来源:skins.c


示例16: DeleteRubiArray

void scContUnit::CharInsert( long		computedOffset,
							 long&		offset,
							 scKeyRecord&	keyRec,
							 long&		tmMove,
							 short& 	rebreak,
							 Bool		textCleared,
							 TypeSpec	clearedSpec )
{
#if SCDEBUG > 1
	{
		static int doit;
		if ( doit )
			fSpecRun.PrintRun( "scContUnit::CharInsert" );
	}
#endif

#ifdef _RUBI_SUPPORT
	if ( fRubiArray ) {
		if ( fRubiArray->IsRubiData( offset + computedOffset ) ) {
			scRubiData rd;
			fRubiArray->GetRubiAt( rd, offset + computedOffset );
			fCharArray.Transform( rd.fStartOffset, rd.fEndOffset, eRemoveJapTran, 0 );

			fRubiArray->DeleteRubiData( offset );
			if ( !fRubiArray->GetNumItems() )
				DeleteRubiArray();
		}
	}
#endif

	if ( computedOffset >= 0 )
		fCharArray.SetNumSlots( fCharArray.GetNumItems() + 1 );
	
	fCharArray.CharInsert( tmMove, 
						   fSpecRun, 
#ifdef _RUBI_SUPPORT
						   fRubiArray,
#endif
						   offset, 
						   keyRec, 
						   textCleared,
						   clearedSpec );

	fSpecRun.SetContentSize( GetContentSize() );

#if SCDEBUG > 1
	{
		static int doit;
		if ( doit )
			fSpecRun.PrintRun( "void scContUnit::CharInsert 2" );
	}
#endif
			
	scTextline* txl = FindLine( offset );
	if ( txl )
		txl->Mark( scREPAINT ); /* force repaint */

	Mark( scREBREAK );

	rebreak = true;
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:61,代码来源:Scparagr.cpp


示例17: Mark

void scContUnit::ReadAPPText( stTextImportExport& appText )
{
	fCharArray.ReadAPPText( fSpecRun, appText );
	Mark( scRETABULATE );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:5,代码来源:Scparagr.cpp


示例18: MAX

Bool scContUnit::ClearText( long		offset1,
							long		offset2 )
{
	scTextline* txl;
	Bool		entireParaDeleted = false;

	offset1 = MAX( MIN( offset1, GetContentSize() ), 0 );
	offset2 = MIN( MAX( offset2, 0 ), GetContentSize() );

	if ( offset1 == 0 && offset2 == GetContentSize() )
		entireParaDeleted = true;

	if ( entireParaDeleted ) {
		GetCharArray().RemoveBetweenOffsets( offset1, offset2 );
		fSpecRun.SetContentSize( 0 );
		
#ifdef _RUBI_SUPPORT
		DeleteRubiArray();
#endif
	}
	else {
		GetCharArray().RemoveBetweenOffsets( offset1, offset2 );
		fSpecRun.Clear( offset1, offset2 );
		GetCharArray().RepairText( fSpecRun, offset1, offset1 );
		
#ifdef _RUBI_SUPPORT
		if ( GetRubiArray() ) {
			GetRubiArray()->DeleteRubiData( offset1, offset2 );
			if ( !GetRubiArray()->GetNumItems() )
				DeleteRubiArray();
		}
#endif
	}

	Mark( scREBREAK );

		/* break link to first line if we remove that text, the refernece
		 * to this text will be patched in the reformatting process
		 */
	txl 			= GetFirstline();

	if ( txl ) {
		scColumn*	col = txl->GetColumn();
		if ( txl && col->GetRecomposition() ) {
			scTextline* nextTxl;
		
			for ( ; txl && txl->GetPara( ) == this; txl = nextTxl ) {
				nextTxl = txl->GetNextLogical();
				if ( offset2 >= txl->GetEndOffset( ) ) {
						// the delete takes care of patching the para
					txl->MarkForDeletion( );
				}
				else {
					long startOffset = MIN( txl->GetStartOffset( ) - offset2, GetContentSize() );
					long endOffset	 = MIN( txl->GetEndOffset( ) - offset2, GetContentSize() );
				
					txl->SetOffsets( startOffset, endOffset );
				}
			}
		}
	}
	
	return entireParaDeleted;
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:64,代码来源:Scparagr.cpp


示例19: Mark

/**
 * If the Bsp's point and vector tables are nearly full, reorder them and delete unused ones.
 */
void FBSPOps::bspRefresh( UModel* Model, bool NoRemapSurfs )
{
	FMemMark Mark(FMemStack::Get());
	int32 *VectorRef, *PointRef, *NodeRef, *PolyRef, i;
	TArray<int32*>	VertexRef;
	uint8  B;

	// Remove unreferenced Bsp surfs.
	NodeRef		= new(FMemStack::Get(),MEM_Oned,Model->Nodes.Num())int32;
	PolyRef		= new(FMemStack::Get(),MEM_Oned,Model->Surfs.Num())int32;
	if( Model->Nodes.Num() > 0 )
		TagReferencedNodes( Model, NodeRef, PolyRef, 0 );

	if( NoRemapSurfs )
		FMemory::Memzero(PolyRef,Model->Surfs.Num() * sizeof (int32));

	// Remap Bsp nodes and surfs.
	int32 n=0;
	for( i=0; i<Model->Surfs.Num(); i++ )
	{
		if( PolyRef[i]!=INDEX_NONE )
		{
			Model->Surfs[n] = Model->Surfs[i];
			PolyRef[i]=n++;
		}
	}
	//UE_LOG(LogBSPOps, Log,  TEXT("Polys: %i -> %i"), Model->Surfs.Num(), n );
	Model->Surfs.RemoveAt( n, Model->Surfs.Num()-n );

	n=0;
	for( i=0; i<Model->Nodes.Num(); i++ ) if( NodeRef[i]!=INDEX_NONE )
	{
		Model->Nodes[n] = Model->Nodes[i];
		NodeRef[i]=n++;
	}
	//UE_LOG(LogBSPOps, Log,  TEXT("Nodes: %i -> %i"), Model->Nodes.Num(), n );
	Model->Nodes.RemoveAt( n, Model->Nodes.Num()-n  );

	// Update Bsp nodes.
	for( i=0; i<Model->Nodes.Num(); i++ )
	{
		FBspNode *Node = &Model->Nodes[i];
		Node->iSurf = PolyRef[Node->iSurf];
		if (Node->iFront != INDEX_NONE) Node->iFront = NodeRef[Node->iFront];
		if (Node->iBack  != INDEX_NONE) Node->iBack  = NodeRef[Node->iBack];
		if (Node->iPlane != INDEX_NONE) Node->iPlane = NodeRef[Node->iPlane];
	}

	// Remove unreferenced points and vectors.
	VectorRef = new(FMemStack::Get(),MEM_Oned,Model->Vectors.Num())int32;
	PointRef  = new(FMemStack::Get(),MEM_Oned,Model->Points .Num ())int32;

	// Check Bsp surfs.
	for( i=0; i<Model->Surfs.Num(); i++ )
	{
		FBspSurf *Surf = &Model->Surfs[i];
		VectorRef [Surf->vNormal   ] = 0;
		VectorRef [Surf->vTextureU ] = 0;
		VectorRef [Surf->vTextureV ] = 0;
		PointRef  [Surf->pBase     ] = 0;
	}

	// Check Bsp nodes.
	for( i=0; i<Model->Nodes.Num(); i++ )
	{
		// Tag all points used by nodes.
		FBspNode*	Node		= &Model->Nodes[i];
		FVert*		VertPool	= &Model->Verts[Node->iVertPool];
		for( B=0; B<Node->NumVertices;  B++ )
		{
			PointRef[VertPool->pVertex] = 0;
			VertPool++;
		}
		Node++;
	}

	// Remap points.
	n=0; 
	for( i=0; i<Model->Points.Num(); i++ ) if( PointRef[i]!=INDEX_NONE )
	{
		Model->Points[n] = Model->Points[i];
		PointRef[i] = n++;
	}
	//UE_LOG(LogBSPOps, Log,  TEXT("Points: %i -> %i"), Model->Points.Num(), n );
	Model->Points.RemoveAt( n, Model->Points.Num()-n );
	check(Model->Points.Num()==n);

	// Remap vectors.
	n=0; for (i=0; i<Model->Vectors.Num(); i++) if (VectorRef[i]!=INDEX_NONE)
	{
		Model->Vectors[n] = Model->Vectors[i];
		VectorRef[i] = n++;
	}
	//UE_LOG(LogBSPOps, Log,  TEXT("Vectors: %i -> %i"), Model->Vectors.Num(), n );
	Model->Vectors.RemoveAt( n, Model->Vectors.Num()-n );

	// Update Bsp surfs.
//.........这里部分代码省略.........
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:101,代码来源:BSPOps.cpp


示例20: ApplyTemporalAA

/** Applies Temporal AA to the light shaft source. */
void ApplyTemporalAA(
	FRHICommandListImmediate& RHICmdList,
	FViewInfo& View, 
	const TCHAR* HistoryRTName,
	/** Contains last frame's history, if non-NULL.  This will be updated with the new frame's history. */
	TRefCountPtr<IPooledRenderTarget>* HistoryState,
	/** Source mask (for either occlusion or bloom). */
	TRefCountPtr<IPooledRenderTarget>& LightShaftsSource, 
	/** Output of Temporal AA for the next step in the pipeline. */
	TRefCountPtr<IPooledRenderTarget>& HistoryOutput)
{
	if (View.FinalPostProcessSettings.AntiAliasingMethod == AAM_TemporalAA
		&& HistoryState)
	{
		if (*HistoryState && !View.bCameraCut)
		{
			FMemMark Mark(FMemStack::Get());
			FRenderingCompositePassContext CompositeContext(RHICmdList, View);
			FPostprocessContext Context(CompositeContext.Graph, View);

			// Nodes for input render targets
			FRenderingCompositePass* LightShaftSetup = Context.Graph.RegisterPass( new(FMemStack::Get()) FRCPassPostProcessInput( LightShaftsSource ) );
			FRenderingCompositePass* HistoryInput = Context.Graph.RegisterPass( new(FMemStack::Get()) FRCPassPostProcessInput( *HistoryState ) );

			// Temporal AA node
			FRenderingCompositePass* NodeTemporalAA = Context.Graph.RegisterPass( new(FMemStack::Get()) FRCPassPostProcessLightShaftTemporalAA );

			// Setup inputs on Temporal AA node as the shader expects
			NodeTemporalAA->SetInput( ePId_Input0, LightShaftSetup );
			NodeTemporalAA->SetInput( ePId_Input1, FRenderingCompositeOutputRef( HistoryInput ) );
			NodeTemporalAA->SetInput( ePId_Input2, FRenderingCompositeOutputRef( HistoryInput ) );

			// Reuse a render target from the pool with a consistent name, for vis purposes
			TRefCountPtr<IPooledRenderTarget> NewHistory;
			AllocateOrReuseLightShaftRenderTarget(RHICmdList, NewHistory, HistoryRTName);

			// Setup the output to write to the new history render target
			Context.FinalOutput = FRenderingCompositeOutputRef(NodeTemporalAA);
			Context.FinalOutput.GetOutput()->RenderTargetDesc = NewHistory->GetDesc();
			Context.FinalOutput.GetOutput()->PooledRenderTarget = NewHistory;

			// Execute Temporal AA
			CompositeContext.Process(Context.FinalOutput.GetPass(), TEXT("LightShaftTemporalAA"));

			// Update the view state's render target reference with the new history
			*HistoryState = NewHistory;
			HistoryOutput = NewHistory;
		}
		else
		{
			// Use the current frame's mask for next frame's history, without invoking the Temporal AA shader
			*HistoryState = LightShaftsSource;
			HistoryOutput = LightShaftsSource;
			LightShaftsSource = NULL;

			AllocateOrReuseLightShaftRenderTarget(RHICmdList, LightShaftsSource, HistoryRTName);
		}
	}
	else
	{
		// Temporal AA is disabled or there is no view state - pass through
		HistoryOutput = LightShaftsSource;
	}
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:65,代码来源:LightShaftRendering.cpp



注:本文中的Mark函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MarkBufferDirty函数代码示例发布时间:2022-05-30
下一篇:
C++ MapWindowPoints函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap