UE4ShaderPluginDemo icon indicating copy to clipboard operation
UE4ShaderPluginDemo copied to clipboard

How to pass a texture input to a compute shader?

Open theodox opened this issue 5 years ago • 2 comments

Thanks for setting this up. The vanilla examples work for me and I've been able to tweak the USFs and that works as well. However I can't see how to pass a texture input to the compute shader. I added a Texture2D input to the usf and added this to the parameter macros:

    SHADER_PARAMETER_TEXTURE(Texture2D, TestTexture)

In the RunComputeShader_RenderThread example, I pass that along:

     PassParameters.TestTexture = DrawParameters.TestTexture->Resource->TextureRHI->GetTexture2D();

However I always hit a check exception:

 Assertion failed: Bindings.StructureLayoutHash == ParametersMetadata->GetLayoutHash() 

Any suggestions on where I should look? The UE documentation is of course entirely nonexistent :(

theodox avatar Jan 03 '20 23:01 theodox

I have the same error. Did you find a solution ? It looks like Epic hates developpers :'(

Chomusuky avatar Apr 08 '20 16:04 Chomusuky

Anybody solved this one?

sasmaster avatar Apr 07 '21 17:04 sasmaster