| 56 | } |
| 57 | |
| 58 | void ApplyDistortion( const Tr2TextureAL& destination, const Tr2TextureAL& distortion, Tr2GpuResourcePool& gpuResourcePool, const Tr2EffectPtr& effect, Tr2RenderContext& renderContext ) |
| 59 | { |
| 60 | auto backBufferCopy = gpuResourcePool.GetTempTexture( "backBufferCopy", destination.GetWidth(), destination.GetHeight(), destination.GetFormat(), Tr2GpuUsage::COPY_DESTINATION | Tr2GpuUsage::SHADER_RESOURCE ); |
| 61 | backBufferCopy->CopySubresourceRegion( {}, destination, {}, renderContext ); |
| 62 | |
| 63 | BeginRenderPass( renderContext, { destination }, {} ); |
| 64 | renderContext.m_esm.ApplyStandardStates( Tr2EffectStateManager::RM_FULLSCREEN ); |
| 65 | effect->SetParameter( BlueSharedString( "BlitCurrent" ), backBufferCopy ); |
| 66 | effect->SetParameter( BlueSharedString( "TexDistortion" ), distortion ); |
| 67 | Tr2Renderer::DrawFullScreenWithShader( renderContext, effect ); |
| 68 | effect->SetParameter( BlueSharedString( "BlitCurrent" ), Tr2TextureAL{} ); |
| 69 | effect->SetParameter( BlueSharedString( "TexDistortion" ), Tr2TextureAL{} ); |
| 70 | } |
| 71 | |
| 72 | struct TimeSection |
| 73 | { |
no test coverage detected