当前位置: 首页>>代码示例>>C++>>正文


C++ FPooledRenderTargetDesc::GenerateInfoString方法代码示例

本文整理汇总了C++中FPooledRenderTargetDesc::GenerateInfoString方法的典型用法代码示例。如果您正苦于以下问题:C++ FPooledRenderTargetDesc::GenerateInfoString方法的具体用法?C++ FPooledRenderTargetDesc::GenerateInfoString怎么用?C++ FPooledRenderTargetDesc::GenerateInfoString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FPooledRenderTargetDesc的用法示例。


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

示例1: QueryInfo

void FVisualizeTexture::QueryInfo( FQueryVisualizeTexureInfo& Out )
{
	for(uint32 i = 0; ; ++i)
	{
		FPooledRenderTarget* RT = GRenderTargetPool.GetElementById(i);
		if (!RT)
		{
			break;
		}

		FPooledRenderTargetDesc Desc = RT->GetDesc();
		uint32 SizeInKB = (RT->ComputeMemorySize() + 1023) / 1024;
		FString Entry = FString::Printf(TEXT("%s %d %s %d"),
				*Desc.GenerateInfoString(),
				i + 1,
				Desc.DebugName ? Desc.DebugName : TEXT("<Unnamed>"),
				SizeInKB);
		Out.Entries.Add(Entry);
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:20,代码来源:VisualizeTexture.cpp

示例2: DebugLog

void FVisualizeTexture::DebugLog(bool bExtended)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
	{
		TArray<FSortedLines> SortedLines;

		for(uint32 i = 0;; ++i)
		{
			FPooledRenderTarget* RT = GRenderTargetPool.GetElementById(i);

			if(!RT)
			{
				break;
			}

			FPooledRenderTargetDesc Desc = RT->GetDesc();

			if(bFullList || (Desc.Flags & TexCreate_HideInVisualizeTexture) == 0)
			{
				uint32 SizeInKB = (RT->ComputeMemorySize() + 1023) / 1024;

				FString UnusedStr;

				if(RT->GetUnusedForNFrames() > 0)
				{
					if(!bFullList)
					{
						continue;
					}

					UnusedStr = FString::Printf(TEXT(" unused(%d)"), RT->GetUnusedForNFrames());
				}

				FSortedLines Element;

				Element.PoolIndex = i;
				
				// sort by index
				Element.SortIndex = i;
				
				if(SortOrder == -1)
				{
					// sort by index
					Element.Line = FString::Printf(TEXT("%s %s %d KB%s"), *Desc.GenerateInfoString(), Desc.DebugName, SizeInKB, *UnusedStr);
				}
				else if(SortOrder == 0)
				{
					// sort by name
					Element.Line = FString::Printf(TEXT("%s %s %d KB%s"), Desc.DebugName, *Desc.GenerateInfoString(), SizeInKB, *UnusedStr);
					Element.SortIndex = 0;
				}
				else if(SortOrder == 1)
				{
					// sort by size (large ones first)
					Element.Line = FString::Printf(TEXT("%d KB %s %s%s"), SizeInKB, *Desc.GenerateInfoString(), Desc.DebugName, *UnusedStr);
					Element.SortIndex = -(int32)SizeInKB;
				}
				else
				{
					check(0);
				}

				SortedLines.Add(Element);
			}
		}

		SortedLines.Sort();

		{
			for(int32 Index = 0; Index < SortedLines.Num(); Index++)
			{
				const FSortedLines& Entry = SortedLines[Index];

				UE_LOG(LogConsoleResponse, Log, TEXT("   %3d = %s"), Entry.PoolIndex + 1, *Entry.Line);
			}
		}

		// clean flags for next use
		bFullList = false;
		SortOrder = -1;
	}
						
	UE_LOG(LogConsoleResponse, Log, TEXT(""));

	// log names (alternative method to look at the rendertargets)
	if(bExtended)
	{
		UE_LOG(LogConsoleResponse, Log, TEXT("CheckpointName (what was rendered this frame, use <Name>@<Number> to get intermediate versions):"));

		TArray<FString> Entries;
				
		// sorted by pointer for efficiency, now we want to print sorted alphabetically
		for (TMap<FString, uint32>:: TIterator It(GRenderTargetPool.VisualizeTexture.VisualizeTextureCheckpoints); It; ++It)
		{
			const FString& Key = It.Key();
			uint32 Value = It.Value();

/*					if(Value)
			{
				// was reused this frame
//.........这里部分代码省略.........
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:101,代码来源:VisualizeTexture.cpp

示例3: PresentContent


//.........这里部分代码省略.........
	RHISetDepthStencilState(TStaticDepthStencilState<false,CF_Always>::GetRHI());

	TShaderMapRef<FPostProcessVS> VertexShader(GetGlobalShaderMap());
	TShaderMapRef<FVisualizeTexturePresentPS> PixelShader(GetGlobalShaderMap());

	static FGlobalBoundShaderState BoundShaderState;

	SetGlobalBoundShaderState(BoundShaderState, GFilterVertexDeclaration.VertexDeclarationRHI, *VertexShader, *PixelShader);

	VertexShader->SetParameters(View);
	PixelShader->SetParameters(View, *VisualizeTextureContent);

	FIntRect DestRect = View.ViewRect;

	FIntRect VisualizeTextureRect = ComputeVisualizeTextureRect(Desc.Extent);

	// Draw a quad mapping scene color to the view's render target
	DrawRectangle(
		VisualizeTextureRect.Min.X, VisualizeTextureRect.Min.Y,
		VisualizeTextureRect.Width(), VisualizeTextureRect.Height(),
		0, 0,
		VisualizeTextureRect.Width(), VisualizeTextureRect.Height(),
		GSceneRenderTargets.GetBufferSizeXY(),
		VisualizeTextureRect.Size(),
		EDRF_Default);

	// this is a helper class for FCanvas to be able to get screen size
	class FRenderTargetTemp : public FRenderTarget
	{
	public:
		const FSceneView& View;

		FRenderTargetTemp(const FSceneView& InView) : View(InView)
		{
		}
		virtual FIntPoint GetSizeXY() const
		{
			return View.UnscaledViewRect.Size();
		};
		virtual const FTexture2DRHIRef& GetRenderTargetTexture() const
		{
			return View.Family->RenderTarget->GetRenderTargetTexture();
		}
	} TempRenderTarget(View);

	FCanvas Canvas(&TempRenderTarget, NULL, View.Family->CurrentRealTime, View.Family->CurrentWorldTime, View.Family->DeltaWorldTime);

	float X = 100 + View.ViewRect.Min.X;
	float Y = 160 + View.ViewRect.Min.Y;
	float YStep = 14;

	{
		uint32 ReuseCount = ObservedDebugNameReusedCurrent;

		FString ExtendedName;
		if(ReuseCount)
		{
			uint32 ReuseGoal = FMath::Min(ReuseCount - 1, ObservedDebugNameReusedGoal);

			// was reused this frame
			ExtendedName = FString::Printf(TEXT("%[email protected]%d @0..%d"), Desc.DebugName, ReuseGoal, ReuseCount - 1);
		}
		else
		{
			// was not reused this frame but can be referenced
			ExtendedName = FString::Printf(TEXT("%s"), Desc.DebugName);
		}

		FString Line = FString::Printf(TEXT("VisualizeTexture: %d \"%s\" RGB*%g+A*%g UV%d"),
			Mode,
			*ExtendedName,
			RGBMul,
			AMul,
			UVInputMapping);
		Canvas.DrawShadowedString( X, Y += YStep, *Line, GetStatsFont(), FLinearColor(1, 1, 1));
	}
	{
		FString Line = FString::Printf(TEXT("   TextureInfoString(): %s"), *(Desc.GenerateInfoString()));
		Canvas.DrawShadowedString( X + 10, Y += YStep, *Line, GetStatsFont(), FLinearColor(1, 1, 1));
	}
	{
		FString Line = FString::Printf(TEXT("  BufferSize:(%d,%d)"), GSceneRenderTargets.GetBufferSizeXY().X, GSceneRenderTargets.GetBufferSizeXY().Y);
		Canvas.DrawShadowedString( X + 10, Y += YStep, *Line, GetStatsFont(), FLinearColor(1, 1, 1));
	}

	const FSceneViewFamily& ViewFamily = *View.Family;

	for(int32 ViewId = 0; ViewId < ViewFamily.Views.Num(); ++ViewId)
	{
		const FSceneView& ViewIt = *ViewFamily.Views[ViewId];
		FString Line = FString::Printf(TEXT("   View #%d: (%d,%d)-(%d,%d)"), ViewId + 1,
			ViewIt.ViewRect.Min.X, ViewIt.ViewRect.Min.Y, ViewIt.ViewRect.Max.X, ViewIt.ViewRect.Max.Y);
		Canvas.DrawShadowedString( X + 10, Y += YStep, *Line, GetStatsFont(), FLinearColor(1, 1, 1));
	}

	X += 40;
	Canvas.DrawShadowedString( X, Y += YStep, TEXT("Blinking Red: <0"), GetStatsFont(), FLinearColor(1,0,0));
	Canvas.DrawShadowedString( X, Y += YStep, TEXT("Blinking Blue: NAN or Inf"), GetStatsFont(), FLinearColor(0,0,1));
	Canvas.Flush();
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:101,代码来源:VisualizeTexture.cpp


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