Actually, let me be a bit more detailed, while also providing some of my own suspicions:
Here’s the code that dispatches the compute shader. In 4.5 I got an error in GetGlobalShaderMap, so I worked around it using GetMaxRHIFeatureLevel(), as can be seen below:
ENQUEUE_UNIQUE_RENDER_COMMAND_TWOPARAMETER(
Compute,
FUnorderedAccessViewRHIRef&, data_uav, data_uav,
dreng_cs_params&, parameters, parameters,
{
TShaderMapRef<FDrengCS> test_cs(GetGlobalShaderMap(GetMaxRHIFeatureLevel()));
//TShaderMapRef<FDrengCS> test_cs(GetGlobalShaderMap());
FComputeShaderRHIParamRef cs_ref = test_cs->GetComputeShader();
RHICmdList.SetComputeShader(cs_ref);
if (test_cs->RWBuffer.IsBound()){
RHICmdList.SetUAVParameter(cs_ref, test_cs->RWBuffer.GetBaseIndex(), data_uav);
}
test_cs->set_uniform_buffers(RHICmdList, parameters);
RHICmdList.DispatchComputeShader(32, 32, 1);
test_cs->unbind_buffers(RHICmdList);
}
);
Another possible reason for the crash is that I’m using this code directly in the Tick function of an Actor. Could there be some limitation in that aspect?