本文整理汇总了C++中TRefCountPtr::IsFree方法的典型用法代码示例。如果您正苦于以下问题:C++ TRefCountPtr::IsFree方法的具体用法?C++ TRefCountPtr::IsFree怎么用?C++ TRefCountPtr::IsFree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRefCountPtr
的用法示例。
在下文中一共展示了TRefCountPtr::IsFree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Process
void FRCPassPostProcessWeightedSampleSum::Process(FRenderingCompositePassContext& Context)
{
const FSceneView& View = Context.View;
FRenderingCompositeOutput *Input = PassInputs[0].GetOutput();
// input is not hooked up correctly
check(Input);
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
// input is not hooked up correctly
check(InputDesc);
const FSceneViewFamily& ViewFamily = *(View.Family);
FIntPoint SrcSize = InputDesc->Extent;
FIntPoint DestSize = PassOutputs[0].RenderTargetDesc.Extent;
// e.g. 4 means the input texture is 4x smaller than the buffer size
FIntPoint SrcScaleFactor = GSceneRenderTargets.GetBufferSizeXY() / SrcSize;
FIntPoint DstScaleFactor = GSceneRenderTargets.GetBufferSizeXY() / DestSize;
TRefCountPtr<IPooledRenderTarget> InputPooledElement = Input->RequestInput();
check(!InputPooledElement->IsFree());
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
FVector2D InvSrcSize(1.0f / SrcSize.X, 1.0f / SrcSize.Y);
// we scale by width because FOV is defined horizontally
float SrcSizeForThisAxis = View.ViewRect.Width() / (float)SrcScaleFactor.X;
// in texel (input resolution), /2 as we use the diameter, 100 as we use percent
float EffectiveBlurRadius = SizeScale * SrcSizeForThisAxis / 2 / 100.0f;
FVector2D BlurOffsets[MAX_FILTER_SAMPLES];
FLinearColor BlurWeights[MAX_FILTER_SAMPLES];
FVector2D OffsetAndWeight[MAX_FILTER_SAMPLES];
const auto FeatureLevel = Context.View.GetFeatureLevel();
// compute 1D filtered samples
uint32 MaxNumSamples = GetMaxNumSamples(FeatureLevel);
uint32 NumSamples = Compute1DGaussianFilterKernel(FeatureLevel, EffectiveBlurRadius, OffsetAndWeight, MaxNumSamples, FilterShape, CrossCenterWeight);
SCOPED_DRAW_EVENTF(Context.RHICmdList, PostProcessWeightedSampleSum, TEXT("PostProcessWeightedSampleSum#%d"), NumSamples);
// compute weights as weighted contributions of the TintValue
for(uint32 i = 0; i < NumSamples; ++i)
{
BlurWeights[i] = TintValue * OffsetAndWeight[i].Y;
}
SetRenderTarget(Context.RHICmdList, DestRenderTarget.TargetableTexture, FTextureRHIRef());
Context.SetViewportAndCallRHI(0, 0, 0.0f, DestSize.X, DestSize.Y, 1.0f);
// set the state
Context.RHICmdList.SetBlendState(TStaticBlendState<>::GetRHI());
Context.RHICmdList.SetRasterizerState(TStaticRasterizerState<>::GetRHI());
Context.RHICmdList.SetDepthStencilState(TStaticDepthStencilState<false, CF_Always>::GetRHI());
const FTextureRHIRef& FilterTexture = InputPooledElement->GetRenderTargetItem().ShaderResourceTexture;
FRenderingCompositeOutput *Input1 = PassInputs[1].GetOutput();
uint32 CombineMethodInt = 0;
if(CombineMethod == EFCM_MaxMagnitude)
{
CombineMethodInt = 2;
}
// can be optimized
FTextureRHIRef AdditiveTexture;
if(Input1)
{
TRefCountPtr<IPooledRenderTarget> InputPooledElement1 = Input1->RequestInput();
AdditiveTexture = InputPooledElement1->GetRenderTargetItem().ShaderResourceTexture;
check(CombineMethod == EFCM_Weighted);
CombineMethodInt = 1;
}
bool bDoFastBlur = DoFastBlur();
if (FilterShape == EFS_Horiz)
{
float YOffset = bDoFastBlur ? (InvSrcSize.Y * 0.5f) : 0.0f;
for (uint32 i = 0; i < NumSamples; ++i)
{
BlurOffsets[i] = FVector2D(InvSrcSize.X * OffsetAndWeight[i].X, YOffset);
}
}
else
{
//.........这里部分代码省略.........