aws / lumberyard

Amazon Lumberyard is a free AAA game engine deeply integrated with AWS and Twitch – with full source.
Other
2.03k stars 540 forks source link

Posteffects blend time optimization #460

Closed alex-leleka closed 4 years ago

alex-leleka commented 4 years ago

Issue #, if available: LY-108315 https://forums.awsgametech.com/t/posteffect-blend-optimization-pull-request/7850 Description of changes:

Small hash map (PostEffectGroupManager::m_paramCache) recreated every frame in CRenderer::SyncMainWithRender. We saved 1.0 - 0.2 = 0.8 ms when frame is GPU bound in PC Profile mode. And 0.5 ms for CPU bound frame. This numbers measured for Intel i7-8700 CPU.

Add new dummy type member to AZStd::variant<float, Vec4, AZStd::string> PostEffectGroupParam. Post effects groups are blended before GPU frame flush and synchronized after flush.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

sconel commented 4 years ago

Hi @alex-leleka , thank for providing this pull request. Looking into it.

AMZN-alexpete commented 4 years ago

Hi @alex-leleka, were you seeing these performance increases when blending depth of field values or others? It'd be great to get your use case, thanks!

alex-leleka commented 4 years ago

Hello @AMZN-alexpete Answered in: https://forums.awsgametech.com/t/posteffect-blend-optimization-pull-request/7850

AMZN-alexpete commented 4 years ago

Thanks for submitting this code @alex-leleka, we've included it in the upcoming 1.26 release!