本文整理汇总了C++中FRHICommandList::TransitionResources方法的典型用法代码示例。如果您正苦于以下问题:C++ FRHICommandList::TransitionResources方法的具体用法?C++ FRHICommandList::TransitionResources怎么用?C++ FRHICommandList::TransitionResources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRHICommandList
的用法示例。
在下文中一共展示了FRHICommandList::TransitionResources方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnsetParameters
void UnsetParameters(FRHICommandList& RHICmdList, IPooledRenderTarget& OutTextureValue)
{
OutTexture.UnsetUAV(RHICmdList, GetComputeShader());
FUnorderedAccessViewRHIParamRef OutUAV = OutTextureValue.GetRenderTargetItem().UAV;
RHICmdList.TransitionResources(EResourceTransitionAccess::EReadable, EResourceTransitionPipeline::EComputeToGfx, &OutUAV, 1);
}
示例2: SetParameters
void SetParameters(
FRHICommandList& RHICmdList,
const FSceneView& View,
int32 SurfelStartIndexValue,
int32 NumSurfelsToGenerateValue,
const FMaterialRenderProxy* MaterialProxy,
FUniformBufferRHIParamRef PrimitiveUniformBuffer,
const FMatrix& Instance0Transform
)
{
FComputeShaderRHIParamRef ShaderRHI = GetComputeShader();
FMaterialShader::SetParameters(RHICmdList, ShaderRHI, MaterialProxy, *MaterialProxy->GetMaterial(View.GetFeatureLevel()), View, View.ViewUniformBuffer, true, ESceneRenderTargetsMode::SetTextures);
SetUniformBufferParameter(RHICmdList, ShaderRHI,GetUniformBufferParameter<FPrimitiveUniformShaderParameters>(),PrimitiveUniformBuffer);
const FScene* Scene = (const FScene*)View.Family->Scene;
FUnorderedAccessViewRHIParamRef UniformMeshUAVs[1];
UniformMeshUAVs[0] = Scene->DistanceFieldSceneData.SurfelBuffers->Surfels.UAV;
RHICmdList.TransitionResources(EResourceTransitionAccess::ERWBarrier, EResourceTransitionPipeline::EComputeToCompute, UniformMeshUAVs, ARRAY_COUNT(UniformMeshUAVs));
SurfelBufferParameters.Set(RHICmdList, ShaderRHI, *Scene->DistanceFieldSceneData.SurfelBuffers, *Scene->DistanceFieldSceneData.InstancedSurfelBuffers);
SetShaderValue(RHICmdList, ShaderRHI, SurfelStartIndex, SurfelStartIndexValue);
SetShaderValue(RHICmdList, ShaderRHI, NumSurfelsToGenerate, NumSurfelsToGenerateValue);
SetShaderValue(RHICmdList, ShaderRHI, Instance0InverseTransform, Instance0Transform.Inverse());
}
示例3: UnsetParameters
void UnsetParameters(FRHICommandList& RHICmdList)
{
ObjectIndirectArguments.UnsetUAV(RHICmdList, GetComputeShader());
FUnorderedAccessViewRHIParamRef OutUAVs[1];
OutUAVs[0] = GShadowCulledObjectBuffers.Buffers.ObjectIndirectArguments.UAV;
RHICmdList.TransitionResources(EResourceTransitionAccess::EReadable, EResourceTransitionPipeline::EComputeToCompute, OutUAVs, ARRAY_COUNT(OutUAVs));
}
示例4: SetParameters
void SetParameters(
FRHICommandList& RHICmdList,
const FViewInfo& View,
FIntPoint TileListGroupSizeValue,
FSceneRenderTargetItem& DistanceFieldNormal,
const FDistanceFieldAOParameters& Parameters,
FSceneRenderTargetItem& SpecularOcclusionBuffer)
{
FComputeShaderRHIParamRef ShaderRHI = GetComputeShader();
FGlobalShader::SetParameters(RHICmdList, ShaderRHI, View);
DeferredParameters.Set(RHICmdList, ShaderRHI, View);
ObjectParameters.Set(RHICmdList, ShaderRHI, GAOCulledObjectBuffers.Buffers);
AOParameters.Set(RHICmdList, ShaderRHI, Parameters);
ScreenGridParameters.Set(RHICmdList, ShaderRHI, View, DistanceFieldNormal);
FAOSampleData2 AOSampleData;
TArray<FVector, TInlineAllocator<9> > SampleDirections;
GetSpacedVectors(SampleDirections);
for (int32 SampleIndex = 0; SampleIndex < NumConeSampleDirections; SampleIndex++)
{
AOSampleData.SampleDirections[SampleIndex] = FVector4(SampleDirections[SampleIndex]);
}
SetUniformBufferParameterImmediate(RHICmdList, ShaderRHI, GetUniformBufferParameter<FAOSampleData2>(), AOSampleData);
FTileIntersectionResources* TileIntersectionResources = View.ViewState->AOTileIntersectionResources;
SetSRVParameter(RHICmdList, ShaderRHI, TileHeadDataUnpacked, TileIntersectionResources->TileHeadDataUnpacked.SRV);
SetSRVParameter(RHICmdList, ShaderRHI, TileArrayData, TileIntersectionResources->TileArrayData.SRV);
SetSRVParameter(RHICmdList, ShaderRHI, TileConeDepthRanges, TileIntersectionResources->TileConeDepthRanges.SRV);
SetShaderValue(RHICmdList, ShaderRHI, TileListGroupSize, TileListGroupSizeValue);
extern float GAOConeHalfAngle;
SetShaderValue(RHICmdList, ShaderRHI, TanConeHalfAngle, FMath::Tan(GAOConeHalfAngle));
FVector UnoccludedVector(0);
for (int32 SampleIndex = 0; SampleIndex < NumConeSampleDirections; SampleIndex++)
{
UnoccludedVector += SampleDirections[SampleIndex];
}
float BentNormalNormalizeFactorValue = 1.0f / (UnoccludedVector / NumConeSampleDirections).Size();
SetShaderValue(RHICmdList, ShaderRHI, BentNormalNormalizeFactor, BentNormalNormalizeFactorValue);
int32 NumOutUAVs = 0;
FUnorderedAccessViewRHIParamRef OutUAVs[1];
OutUAVs[NumOutUAVs++] = SpecularOcclusionBuffer.UAV;
RHICmdList.TransitionResources(EResourceTransitionAccess::ERWBarrier, EResourceTransitionPipeline::EComputeToCompute, OutUAVs, NumOutUAVs);
SpecularOcclusion.SetTexture(RHICmdList, ShaderRHI, SpecularOcclusionBuffer.ShaderResourceTexture, SpecularOcclusionBuffer.UAV);
}
示例5: UnsetParameters
void UnsetParameters(FRHICommandList& RHICmdList, FSceneRenderTargetItem& SpecularOcclusionBuffer)
{
SpecularOcclusion.UnsetUAV(RHICmdList, GetComputeShader());
int32 NumOutUAVs = 0;
FUnorderedAccessViewRHIParamRef OutUAVs[1];
OutUAVs[NumOutUAVs++] = SpecularOcclusionBuffer.UAV;
RHICmdList.TransitionResources(EResourceTransitionAccess::EReadable, EResourceTransitionPipeline::EComputeToCompute, OutUAVs, NumOutUAVs);
}
示例6: UnsetParameters
void UnsetParameters(FRHICommandList& RHICmdList, FViewInfo& View)
{
FComputeShaderRHIParamRef ShaderRHI = GetComputeShader();
SurfelBufferParameters.UnsetParameters(RHICmdList, ShaderRHI);
const FScene* Scene = (const FScene*)View.Family->Scene;
FUnorderedAccessViewRHIParamRef UniformMeshUAVs[1];
UniformMeshUAVs[0] = Scene->DistanceFieldSceneData.SurfelBuffers->Surfels.UAV;
RHICmdList.TransitionResources(EResourceTransitionAccess::EReadable, EResourceTransitionPipeline::EComputeToCompute, UniformMeshUAVs, ARRAY_COUNT(UniformMeshUAVs));
}
示例7: UnsetParameters
void UnsetParameters(FRHICommandList& RHICmdList, const FViewInfo& View)
{
ScreenGridConeVisibility.UnsetUAV(RHICmdList, GetComputeShader());
ConeDepthVisibilityFunction.UnsetUAV(RHICmdList, GetComputeShader());
FAOScreenGridResources* ScreenGridResources = View.ViewState->AOScreenGridResources;
int32 NumOutUAVs = 0;
FUnorderedAccessViewRHIParamRef OutUAVs[2];
OutUAVs[NumOutUAVs++] = ScreenGridResources->ScreenGridConeVisibility.UAV;
if (bSupportIrradiance)
{
OutUAVs[NumOutUAVs++] = ScreenGridResources->ConeDepthVisibilityFunction.UAV;
}
RHICmdList.TransitionResources(EResourceTransitionAccess::EReadable, EResourceTransitionPipeline::EComputeToCompute, OutUAVs, NumOutUAVs);
}
示例8: SetParameters
void SetParameters(
FRHICommandList& RHICmdList,
const FSceneView& View,
int32 ViewIndex,
int32 NumViews,
const TArray<FSortedLightSceneInfo, SceneRenderingAllocator>& SortedLights,
int32 NumLightsToRenderInSortedLights,
const FSimpleLightArray& SimpleLights,
int32 StartIndex,
int32 NumThisPass,
IPooledRenderTarget& InTextureValue,
IPooledRenderTarget& OutTextureValue)
{
FComputeShaderRHIParamRef ShaderRHI = GetComputeShader();
FGlobalShader::SetParameters(RHICmdList, ShaderRHI, View);
DeferredParameters.Set(RHICmdList, ShaderRHI, View);
SetTextureParameter(RHICmdList, ShaderRHI, InTexture, InTextureValue.GetRenderTargetItem().ShaderResourceTexture);
FUnorderedAccessViewRHIParamRef OutUAV = OutTextureValue.GetRenderTargetItem().UAV;
RHICmdList.TransitionResources(EResourceTransitionAccess::ERWBarrier, EResourceTransitionPipeline::EGfxToCompute, &OutUAV, 1);
OutTexture.SetTexture(RHICmdList, ShaderRHI, 0, OutUAV);
SetShaderValue(RHICmdList, ShaderRHI, ViewDimensions, View.ViewRect);
SetTextureParameter(
RHICmdList,
ShaderRHI,
PreIntegratedBRDF,
PreIntegratedBRDFSampler,
TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI(),
GEngine->PreIntegratedSkinBRDFTexture->Resource->TextureRHI
);
static const auto AllowStaticLightingVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.AllowStaticLighting"));
const bool bAllowStaticLighting = (!AllowStaticLightingVar || AllowStaticLightingVar->GetValueOnRenderThread() != 0);
FTiledDeferredLightData LightData;
FTiledDeferredLightData2 LightData2;
for (int32 LightIndex = 0; LightIndex < NumThisPass; LightIndex++)
{
if (StartIndex + LightIndex < NumLightsToRenderInSortedLights)
{
const FSortedLightSceneInfo& SortedLightInfo = SortedLights[StartIndex + LightIndex];
const FLightSceneInfoCompact& LightSceneInfoCompact = SortedLightInfo.SceneInfo;
const FLightSceneInfo* const LightSceneInfo = LightSceneInfoCompact.LightSceneInfo;
FVector NormalizedLightDirection;
FVector2D SpotAngles;
float SourceRadius;
float SourceLength;
float MinRoughness;
// Get the light parameters
LightSceneInfo->Proxy->GetParameters(
LightData.LightPositionAndInvRadius[LightIndex],
LightData.LightColorAndFalloffExponent[LightIndex],
NormalizedLightDirection,
SpotAngles,
SourceRadius,
SourceLength,
MinRoughness);
if (LightSceneInfo->Proxy->IsInverseSquared())
{
// Correction for lumen units
LightData.LightColorAndFalloffExponent[LightIndex].X *= 16.0f;
LightData.LightColorAndFalloffExponent[LightIndex].Y *= 16.0f;
LightData.LightColorAndFalloffExponent[LightIndex].Z *= 16.0f;
LightData.LightColorAndFalloffExponent[LightIndex].W = 0;
}
// When rendering reflection captures, the direct lighting of the light is actually the indirect specular from the main view
if (View.bIsReflectionCapture)
{
LightData.LightColorAndFalloffExponent[LightIndex].X *= LightSceneInfo->Proxy->GetIndirectLightingScale();
LightData.LightColorAndFalloffExponent[LightIndex].Y *= LightSceneInfo->Proxy->GetIndirectLightingScale();
LightData.LightColorAndFalloffExponent[LightIndex].Z *= LightSceneInfo->Proxy->GetIndirectLightingScale();
}
{
// SpotlightMaskAndMinRoughness, >0:Spotlight, MinRoughness = abs();
float W = FMath::Max(0.0001f, MinRoughness) * ((LightSceneInfo->Proxy->GetLightType() == LightType_Spot) ? 1 : -1);
LightData2.LightDirectionAndSpotlightMaskAndMinRoughness[LightIndex] = FVector4(NormalizedLightDirection, W);
}
LightData2.SpotAnglesAndSourceRadiusAndSimpleLighting[LightIndex] = FVector4(SpotAngles.X, SpotAngles.Y, SourceRadius, 0);
int32 ShadowMapChannel = LightSceneInfo->Proxy->GetShadowMapChannel();
if (!bAllowStaticLighting)
{
ShadowMapChannel = INDEX_NONE;
}
LightData2.ShadowMapChannelMask[LightIndex] = FVector4(
ShadowMapChannel == 0 ? 1 : 0,
ShadowMapChannel == 1 ? 1 : 0,
//.........这里部分代码省略.........