PopcornFX / O3DEPopcornFXPlugin

PopcornFX plugin for O3DE
https://www.popcornfx.com/
Other
13 stars 12 forks source link

Multiple asserts in debug when running MultiplayerSample #50

Closed mbalfour-amzn closed 1 year ago

mbalfour-amzn commented 1 year ago

I've built MultiplayerSample with the following:

(This uses PopcornFX 2.16.3)

When running MultiplayerSample.GameLauncher in debug, the following asserts get triggered:

[ERR1][O3DE]> !! PopcornFX Assertion failed !!
File       : D:/github/o3de-multiplayersample-assets/Gems/O3DEPopcornFXPlugin/Code/Source/Integration/Render/AtomIntegration/AtomRendererCache.cpp(588)
Function   : PopcornFX::SParticleMaterialBasicDesc::InitFromRenderer(...)
Message    : m_PipelineStateKey.m_UsedShader != EPopcornFXShader::__Shader_Count
Condition  : m_PipelineStateKey.m_UsedShader != EPopcornFXShader::__Shader_Count
Expanded   : m_PipelineStateKey.m_UsedShader != EPopcornFXShader::__Shader_Count
ThreadID   : 0
AssertNum  : 0

PopcornFX Assertion Failed:
D:/github/o3de-multiplayersample-assets/Gems/O3DEPopcornFXPlugin/Code/Source/Integration/Render/AtomIntegration/AtomRendererCache.cpp(588)
    PopcornFX::SParticleMaterialBasicDesc::InitFromRenderer(...)

Message:  m_PipelineStateKey.m_UsedShader != EPopcornFXShader::__Shader_Count
Failed:   m_PipelineStateKey.m_UsedShader != EPopcornFXShader::__Shader_Count
Expanded: m_PipelineStateKey.m_UsedShader != EPopcornFXShader::__Shader_Count

CallContext:
    - Asset: particles/fx_jumppad.pkfx
[ERR1][O3DE]> !! PopcornFX Assertion failed !!
File       : D:\ly\lyengine\3rdParty\packages\PopcornFX-2.16.3-O3DE-windows\PopcornFX\Runtime\pk_kernel/include/kr_memoryviews.h(395)
Function   : PopcornFX::TStridedMemoryView<float const ,-1>::ToMemoryView(...)
Condition  : (!BaseType::Virtual() && Contiguous()) || (BaseType::Virtual() && BaseType::m_Storage.m_Count == 1)
ThreadID   : 0
AssertNum  : 1

PopcornFX Assertion Failed:
D:\ly\lyengine\3rdParty\packages\PopcornFX-2.16.3-O3DE-windows\PopcornFX\Runtime\pk_kernel/include/kr_memoryviews.h(395)
    PopcornFX::TStridedMemoryView<float const ,-1>::ToMemoryView(...)

Message:  (!BaseType::Virtual() && Contiguous()) || (BaseType::Virtual() && BaseType::m_Storage.m_Count == 1)
Failed:   (!BaseType::Virtual() && Contiguous()) || (BaseType::Virtual() && BaseType::m_Storage.m_Count == 1)
Expanded: (!BaseType::Virtual() && Contiguous()) || (BaseType::Virtual() && BaseType::m_Storage.m_Count == 1)
[ERR1][O3DE]> !! PopcornFX Assertion failed !!
File       : D:\ly\lyengine\3rdParty\packages\PopcornFX-2.16.3-O3DE-windows\PopcornFX\Runtime\pk_kernel/include/kr_mem_utils.h(33)
Function   : PopcornFX::Mem::Copy(...)
Condition  : !Mem::Overlaps(dst, byteCount, src, byteCount)
ThreadID   : 2
AssertNum  : 2

PopcornFX Assertion Failed:
D:\ly\lyengine\3rdParty\packages\PopcornFX-2.16.3-O3DE-windows\PopcornFX\Runtime\pk_kernel/include/kr_mem_utils.h(33)
    PopcornFX::Mem::Copy(...)

Message:  !Mem::Overlaps(dst, byteCount, src, byteCount)
Failed:   !Mem::Overlaps(dst, byteCount, src, byteCount)
Expanded: !Mem::Overlaps(dst, byteCount, src, byteCount)

CallContext:
    - Asset: particles/energyballtrap/fx_energyballtrap_buildup.pkfx

The first assert appears to be caused by the following in AtomRendererCache.cpp:

    else if (m_PipelineStateKey.m_BlendMode == BlendMode::BlendMode_Count) // No explicit blend mode, can use new materials...
    {
        if (renderer.m_RendererType == ERendererClass::Renderer_Billboard)
            m_PipelineStateKey.m_UsedShader = EPopcornFXShader::Billboard_Shader;
    }

When the assert triggers, m_BlendMode is BlendMode_Count, but m_RendererType is Renderer_Light, so no shader gets set.

Not sure what's causing the other asserts.

mbalfour-amzn commented 1 year ago

For the third assert, the callstack looks like this:

    PopcornFX.dll!PopcornFX::Mem::Copy(void * dst, const void * src, unsigned __int64 byteCount) Line 33    C++
    PopcornFX.dll!PopcornFX::CParticleTask_KickEvent::_EraseSlice(unsigned int begin, unsigned int end) Line 963    C++
>   PopcornFX.dll!PopcornFX::CParticleTask_KickEvent::_RemoveKilledEffectsFromDirectBatchIFN() Line 1020    C++
    PopcornFX.dll!PopcornFX::CParticleTask_KickEvent::_VirtualLaunch(PopcornFX::Threads::SThreadContext & threadContext) Line 1107  C++
    PopcornFX.dll!PopcornFX::CAsynchronousJob::_LaunchReady(PopcornFX::Threads::SThreadContext & threadContext) Line 230    C++
    PopcornFX.dll!PopcornFX::CAsynchronousJob::Run(PopcornFX::Threads::SThreadContext & threadContext) Line 143 C++
    PopcornFX.dll!PopcornFX::CWorkerThread::Run() Line 123  C++
    PopcornFX.dll!PopcornFX::CThread::ThreadStartAddress(void * param) Line 643 C++
HugoPKFX commented 1 year ago

Hi @mbalfour-amzn ,

The following is normally a false positive, occurs when an effect being loaded contains light particles (this was fixed in development and will be released in v2.15.10 / v2.16.5):

[ERR1][O3DE]> !! PopcornFX Assertion failed !! File : D:/github/o3de-multiplayersample-assets/Gems/O3DEPopcornFXPlugin/Code/Source/Integration/Render/AtomIntegration/AtomRendererCache.cpp(588) Function : PopcornFX::SParticleMaterialBasicDesc::InitFromRenderer(...) Message : m_PipelineStateKey.m_UsedShader != EPopcornFXShader::Shader_Count Condition : m_PipelineStateKey.m_UsedShader != EPopcornFXShader::__Shader_Count Expanded : m_PipelineStateKey.m_UsedShader != EPopcornFXShader::Shader_Count ThreadID : 0 AssertNum : 0

image

The other asserts are more problematic, we'll take a look asap

ValPKFX commented 1 year ago

Hi, sorry for the delay. I pushed a fix on development for the second assert and will be included in the next release. I haven't been able to reproduce the third assert yet. I will do more in-depth tests.

ValPKFX commented 1 year ago

The last assert is now fixed and pushed on the development branch. Since this is a runtime fix, this is include in the commit c902351 which will downloads preview packages of 2.16.6.