Consistent Crash at FGlobalShaderMap::AddSection

I’ve been trying to make a Marching Cubes compute shader plugin with the new RDG framework. I recently made a bunch of changes without attempting to run UE4 on my changes. Now whenever I try to run it, I get the same error consistently at 18% loaded.

All the error says is

Specifically, this is where the following code is called:

When I check the debug logs, I can see that the execution gets through InitializingShaderTypes, but right before it crashes there’s an error from LogShaders that says

Mismatch size for type FMarchingCubesCS, compiled size is 288, loaded size is 280.

Immediately after this the InSection assertion fails.

I’m not really sure what’s causing this. I’m using Rider for Unreal Engine, so the debug functionalities are limited and I can’t add breakpoints to see when the AddSection method is called. I think though that the problem is caused at some point during ShaderCompiler::CompileGlobalShaderMap. But that’s just a hunch.


Does anyone have any suggestions on how to investigate this further or how to fix it?

This is my Shader class for reference (in a .cpp class separate from the IModule implementation).

Update: When I shift around the shader parameter struct to be a global parameter struct outside of the class definition, there’s not really a problem. But I’m not sure how to pass those parameters in an RDG pass, because I can’t seem to find anything about whether or not that’s different than a nonglobal parameter struct. I was also able to bypass this problem by removing the PointsIn and TrianglesOut RDG buffer implementations, but I’d like to have an input buffer and output append structured buffers (if I need more).