本文整理汇总了C++中FRHICommandList::SetShaderResourceViewParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ FRHICommandList::SetShaderResourceViewParameter方法的具体用法?C++ FRHICommandList::SetShaderResourceViewParameter怎么用?C++ FRHICommandList::SetShaderResourceViewParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRHICommandList
的用法示例。
在下文中一共展示了FRHICommandList::SetShaderResourceViewParameter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnbindBuffers
void UnbindBuffers(FRHICommandList& RHICmdList)
{
// TODO: Is this necessary here?
FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
#if LPV_VOLUME_TEXTURE
for ( int i=0; i<7; i++ )
{
if ( LpvBufferSRVParameters[i].IsBound() )
{
RHICmdList.SetShaderTexture(ShaderRHI, LpvBufferSRVParameters[i].GetBaseIndex(), FTextureRHIParamRef());
}
}
#else
if ( InLpvBuffer.IsBound() ) RHICmdList.SetShaderResourceViewParameter( ShaderRHI, InLpvBuffer.GetBaseIndex(), FShaderResourceViewRHIParamRef() );
#endif
#if LPV_GV_VOLUME_TEXTURE
for ( int i=0; i<3; i++ )
{
if ( GvBufferSRVParameters[i].IsBound() )
{
RHICmdList.SetShaderTexture(ShaderRHI, GvBufferSRVParameters[i].GetBaseIndex(), FTextureRHIParamRef());
}
}
#else
if ( InGvBuffer.IsBound() ) RHICmdList.SetShaderResourceViewParameter( ShaderRHI, InGvBuffer.GetBaseIndex(), FShaderResourceViewRHIParamRef() );
#endif
}
示例2: SetMesh
virtual void SetMesh(FRHICommandList& RHICmdList, FShader* Shader, const FVertexFactory* VertexFactory, const FSceneView& View, const FMeshBatchElement& BatchElement, uint32 DataFlags) const override
{
if(Shader->GetVertexShader())
{
// Call regular GPU skinning shader parameters
FGPUSkinVertexFactoryShaderParameters::SetMesh(RHICmdList, Shader, VertexFactory, View, BatchElement, DataFlags);
const auto* GPUSkinVertexFactory = (const FGPUBaseSkinVertexFactory*)VertexFactory;
// A little hacky; problem is we can't upcast from FGPUBaseSkinVertexFactory to FGPUBaseSkinAPEXClothVertexFactory as they are unrelated; a nice solution would be
// to use virtual inheritance, but that requires RTTI and complicates things further...
const FGPUBaseSkinAPEXClothVertexFactory::ClothShaderType& ClothShaderData = GPUSkinVertexFactory->UsesExtraBoneInfluences()
? ((const TGPUSkinAPEXClothVertexFactory<true>*)GPUSkinVertexFactory)->GetClothShaderData()
: ((const TGPUSkinAPEXClothVertexFactory<false>*)GPUSkinVertexFactory)->GetClothShaderData();
SetUniformBufferParameter(RHICmdList, Shader->GetVertexShader(),Shader->GetUniformBufferParameter<FAPEXClothUniformShaderParameters>(),ClothShaderData.GetClothUniformBuffer());
// we tell the shader where to pickup the data
if(ClothSimulPositionsParameter.IsBound())
{
RHICmdList.SetShaderResourceViewParameter(Shader->GetVertexShader(), ClothSimulPositionsParameter.GetBaseIndex(), ClothShaderData.GetClothSimulPositionBuffer().VertexBufferSRV);
}
if(ClothSimulNormalsParameter.IsBound())
{
RHICmdList.SetShaderResourceViewParameter(Shader->GetVertexShader(), ClothSimulNormalsParameter.GetBaseIndex(), ClothShaderData.GetClothSimulNormalBuffer().VertexBufferSRV);
}
SetShaderValue(
RHICmdList,
Shader->GetVertexShader(),
ClothBlendWeightParameter,
ClothShaderData.ClothBlendWeight
);
}
}
示例3: SetParameters
void SetParameters(FRHICommandList& RHICmdList, uint32 InputStreamStride, uint32 InputStreamFloatOffset, uint32 InputStreamVertexCount, uint32 OutputBufferFloatOffset, FBoneBufferTypeRef BoneBuffer, FUniformBufferRHIRef UniformBuffer, FShaderResourceViewRHIRef VertexBufferSRV, FRWBuffer& SkinBuffer, const FVector& MeshOrigin, const FVector& MeshExtension)
{
FComputeShaderRHIParamRef ComputeShaderRHI = GetComputeShader();
SetShaderValue(RHICmdList, ComputeShaderRHI, SkinMeshOriginParameter, MeshOrigin);
SetShaderValue(RHICmdList, ComputeShaderRHI, SkinMeshExtensionParameter, MeshExtension);
SetShaderValue(RHICmdList, ComputeShaderRHI, SkinInputStreamStride, InputStreamStride);
SetShaderValue(RHICmdList, ComputeShaderRHI, SkinInputStreamVertexCount, InputStreamVertexCount);
SetShaderValue(RHICmdList, ComputeShaderRHI, SkinInputStreamFloatOffset, InputStreamFloatOffset);
SetShaderValue(RHICmdList, ComputeShaderRHI, SkinOutputBufferFloatOffset, OutputBufferFloatOffset);
if (UniformBuffer)
{
SetUniformBufferParameter(RHICmdList, ComputeShaderRHI, GetUniformBufferParameter<GPUSkinCacheBonesUniformShaderParameters>(), UniformBuffer);
}
else
{
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, BoneMatrices.GetBaseIndex(), BoneBuffer.VertexBufferSRV);
}
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, SkinInputStream.GetBaseIndex(), VertexBufferSRV);
RHICmdList.SetUAVParameter(
ComputeShaderRHI,
SkinCacheBufferRW.GetBaseIndex(),
SkinBuffer.UAV
);
}
示例4: UnsetParameters
void UnsetParameters(FRHICommandList& RHICmdList)
{
FComputeShaderRHIParamRef ComputeShaderRHI = GetComputeShader();
FShaderResourceViewRHIParamRef NullSRV = FShaderResourceViewRHIParamRef();
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, BoneMatrices.GetBaseIndex(), NullSRV);
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, SkinInputStream.GetBaseIndex(), NullSRV);
RHICmdList.SetUAVParameter( ComputeShaderRHI, SkinCacheBufferRW.GetBaseIndex(), FUnorderedAccessViewRHIParamRef() );
}
示例5: UnbindBuffers
void FFluidSimConfinementShader::UnbindBuffers(FRHICommandList& RHICmdList)
{
FComputeShaderRHIParamRef ComputeShaderRHI = GetComputeShader();
if (ObstaclesIn.IsBound())
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, ObstaclesIn.GetBaseIndex(), FShaderResourceViewRHIRef());
if (VorticityIn.IsBound())
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, VorticityIn.GetBaseIndex(), FShaderResourceViewRHIRef());
if (VelocityIn.IsBound())
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, VelocityIn.GetBaseIndex(), FShaderResourceViewRHIRef());
if (VelocityOut.IsBound())
RHICmdList.SetUAVParameter(ComputeShaderRHI, VelocityOut.GetBaseIndex(), FUnorderedAccessViewRHIRef());
}
示例6: SetParameters
void SetParameters(
FRHICommandList& RHICmdList,
const FLightPropagationVolume* LPV,
const FSceneView& View )
{
FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
FGlobalShader::SetParameters(RHICmdList, ShaderRHI, View);
#if LPV_VOLUME_TEXTURE
for ( int i=0; i<7; i++ )
{
FTextureRHIParamRef LpvBufferSrv = LPV->LpvVolumeTextures[ 1-LPV->mWriteBufferIndex ][i]->GetRenderTargetItem().ShaderResourceTexture;
if ( LpvBufferSRVParameters[i].IsBound() )
{
RHICmdList.SetShaderTexture(ShaderRHI, LpvBufferSRVParameters[i].GetBaseIndex(), LpvBufferSrv);
}
SetTextureParameter(RHICmdList, ShaderRHI, LpvBufferSRVParameters[i], LpvVolumeTextureSampler, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI(), LpvBufferSrv );
}
#else
if ( InLpvBuffer.IsBound() )
{
RHICmdList.SetShaderResourceViewParameter( ShaderRHI, InLpvBuffer.GetBaseIndex(), LPV->mLpvBuffers[ LPV->mWriteBufferIndex ]->SRV );
}
#endif
#if LPV_GV_VOLUME_TEXTURE
for ( int i=0; i<3; i++ )
{
FTextureRHIParamRef GvBufferSrv = LPV->GvVolumeTextures[i]->GetRenderTargetItem().ShaderResourceTexture;
if ( GvBufferSRVParameters[i].IsBound() )
{
RHICmdList.SetShaderTexture(ShaderRHI, GvBufferSRVParameters[i].GetBaseIndex(), GvBufferSrv);
}
SetTextureParameter(RHICmdList, ShaderRHI, GvBufferSRVParameters[i], LpvVolumeTextureSampler, TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI(), GvBufferSrv );
}
#else
if ( InGvBuffer.IsBound() )
{
RHICmdList.SetShaderResourceViewParameter( ShaderRHI, InGvBuffer.GetBaseIndex(), LPV->GvBuffer->SRV );
}
#endif
}
示例7: SetSurfaces
void FFluidSimVorticityShader::SetSurfaces(
FRHICommandList& RHICmdList,
FShaderResourceViewRHIRef VelocityInSRV,
FUnorderedAccessViewRHIRef VorticityOutUAV
)
{
FComputeShaderRHIParamRef ComputeShaderRHI = GetComputeShader();
if (VelocityIn.IsBound())
RHICmdList.SetShaderResourceViewParameter(ComputeShaderRHI, VelocityIn.GetBaseIndex(), VelocityInSRV);
if (VorticityOut.IsBound())
RHICmdList.SetUAVParameter(ComputeShaderRHI, VorticityOut.GetBaseIndex(), VorticityOutUAV);
}