I am working on a project based on Unreal Engine 4 where I need to implement a customized directx11 compute shader. I am following this tutorial:Unreal HLSL Tutorial to write a customized compute shader in Unreal Engine for my project.
I used the following codes to bind the resource to the compute shader:
InputSurface.Bind(Initializer.ParameterMap, TEXT("InputSurfaceCS"));
OutputSurface.Bind(Initializer.ParameterMap, TEXT("OutputSurface"));
However, I realized that only OutputSurface is recognized by the compiler and the compiler assigned a resource to it, but the compiler didn't assign any resource to the InputSurfaceCS resource.
In the compute shader .usf file, I decalared these parameters like this:
Texture2D<float> InputSurfaceCS;
RWTexture2D<float> OutputSurface;
Does anyone run into this problem before? or know how to solve it?
Thanks, ZH