コード例 #1
0
    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
0
    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
    }