First of all, let me tell you that I highly appreciate your tutorials, I would have found it impossible to get into this topic without them.
I attempted to run your project with 4.28. After patching UpdateDeformTransformsSB_RenderThread to check that DeformTransformsSB != nullptr I got the editor working and it shows the statue just fine. I assume maybe the order in which things are initialized must have changed between versions.
Anyways, when I try to run the game itself I get the following error log:
FD3D11DynamicRHI::RHICreateVertexBuffer()
FD3D11DynamicRHI::CreateVertexBuffer_RenderThread()
FPositionVertexBuffer::CreateRHIBuffer_Internal<1>()
FPositionVertexBuffer::InitRHI()
InitOrUpdateResource() [CustomMeshComponent\Source\DeformMesh\Private\Components\DeformMeshComponent.cpp:1
<lambda_2d7339148efd183a3d3d33b3b2efb563>::operator()() [CustomMeshComponent\Source\DeformMesh\Private\Components\DeformMeshComponent.cpp:2
TEnqueueUniqueRenderCommandType<InitVertexFactoryData'::
2'::StaticMeshVertexBuffersLegacyInitName,<lambda_2d7339148efd183a3d3d33b3b2efb563> >::DoTask() [Engine\Source\Runtime\RenderCore\Public\RenderingThread.h:1
TGraphTask<TEnqueueUniqueRenderCommandType<InitVertexFactoryData'::
2'::StaticMeshVertexBuffersLegacyInitName,<lambda_2d7339148efd183a3d3d33b3b2efb563> > >::ExecuteTask() [Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:8
FNamedTaskThread::ProcessTasksNamedThread()
FNamedTaskThread::ProcessTasksUntilQuit()
RenderingThreadMain()
FRenderingThread::Run()
FRunnableThreadWin::Run()
FRunnableThreadWin::GuardedRun()
From what I can gather, during the initialization of the PositionVertexBuffer in StaticMeshVertexBuffersLegacyInit
a check(Size > 0) fails in FD3D11DynamicRHI::RHICreateVertexBuffer() on line24 D3D11VertexBuffer.cpp:
if (CreateInfo.bWithoutNativeResource)
{
return new FD3D11VertexBuffer();
}
// Explicitly check that the size is nonzero before allowing CreateVertexBuffer to opaquely fail.
check(Size > 0);
Unfortunately I cant seem to debug the launched game (only the editor), so I'm left to look at the code. I see from
FVertexBufferRHIRef FPositionVertexBuffer::CreateRHIBuffer_Internal() in PositionVertexBuffer.cpp
FResourceArrayInterface* RESTRICT ResourceArray = VertexData ? VertexData->GetResourceArray() : nullptr;
const uint32 SizeInBytes = ResourceArray ? ResourceArray->GetResourceDataSize() : 0;
FRHIResourceCreateInfo CreateInfo(ResourceArray);
CreateInfo.bWithoutNativeResource = !VertexData;
if (bRenderThread)
{
return RHICreateVertexBuffer(SizeInBytes, BUF_Static | BUF_ShaderResource, CreateInfo);
}
I know from PositionVertexBuffer.cpp that bWithoutNativeResource is false, i.e. VertexData is not nullptr so either the VertexData resource is not initialized or its size is 0.
Again, I suppose the order in which things are initialized must have changed and without being able to debug I feel very much stuck. Any chance you could give me a hint on how to approach this?
Best regards,
Oskar