NVIDIA GameWorks Integration

I have do something for it.
I find the problem.The reason it crashed is that Array index out of bounds.
At file \Engine\Source\Runtime\Renderer\Private\BasePassRendering.h”
The function ConfigureWaveWorksInputMapping()and ConfigureWaveWorksInputMapping ();
Actually these function has the same problem.It is that *WaveWorksShaderParams-> ShaderInputMappings *is empty.

And then I try to find where it init at. After a period of time debugging, at last I find the reason of ShaderInputMappings being empty is
It can not get WaveworksResource in file:
\Engine\Source\Runtime\Engine\Private\Components\WaveWorksComponent.cpp”**
The fouction*** UWaveWorksComponent::CalcBounds();***
And The function UWaveWorks::GetWaveWorksResource() in file:
\Engine\Source\Runtime\Engine\Private\WaveWorks.cpp”

// GetWaveWorksResource()
class FWaveWorksResource UWaveWorks::GetWaveWorksResource()*
{
*** FWaveWorksResource* Result = NULL;***
*** if( WaveWorksResource && WaveWorksResource->IsInitialized() )***
*** {***
*** Result = (FWaveWorksResource*)WaveWorksResource;***
*** }***
*** return Result;***
}
I try to set breakpoints at function,there was something interesting.
It is amazing that the return of function(WaveWorksResource->IsInitialized()) is different when it run with editor and no-editor.

So I try to find the reason of it. Then I find it init at file :
\Engine\Source\Runtime\Engine\Private\WaveWorks.cpp”
In function :*** UWaveWorks::UpdateResource()***

// UWaveWorks::UpdateResource()
void UWaveWorks::UpdateResource()
{
*** // Release the existing texture resource.***
*** ReleaseResource();***

*** //Dedicated servers have no texture internals***
*** if (FApp::CanEverRender() && !HasAnyFlags(RF_ClassDefaultObject))***
*** {***
*** // Create a new texture resource.***
*** WaveWorksResource = new FWaveWorksResource();***
*** BeginInitResource(WaveWorksResource);***
*** }***
}
At last I know why the return of WaveWorksResource->IsInitialized() is false.
When it run with editor,after function ***BeginInitResource(WaveWorksResource) ***beginning, render theard will run before ***UWaveWorksComponent::CalcBounds() ***beginning.
But when it run without editor, after function ***BeginInitResource(WaveWorksResource) ***beginning, render theard will run after ***UWaveWorksComponent::CalcBounds() ***beginning.
So without editor,when ***UWaveWorksComponent::CalcBounds() *beginning, WaveWorksResource’s render theard have not started.So the return of WaveWorksResource->IsInitialized() is false.

Yesterday,I find that it also crashed with editor when you use a new WaveworksAsset.
I think the problem of it is Serialization.You can do test: Create a new waveworksasset and use it in a waveworkscomponent.Your editor will crashed and the erro log is the same.