-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UE5.3 compatibility - getting errors in compute shader base #11
Comments
Thanks for the report I just pushed an update today that should bring Shadeup fully up-to-date with UE 5.3 The following should fix both your errors above: In #include "MeshPassUtils.h" and replace the lines found around 140-180 with the following PassParameters->OutputColor = GraphBuilder.CreateUAV(FRDGBufferUAVDesc(OutputBuffer, PF_A32B32G32R32F));
FViewUniformShaderParameters ViewUniformShaderParameters;
ViewUniformShaderParameters.GameTime = Params.GameTime;
ViewUniformShaderParameters.RealTime = Params.GameTime;
ViewUniformShaderParameters.Random = Params.Random;
auto ViewUniformBuffer = TUniformBufferRef<FViewUniformShaderParameters>::CreateUniformBufferImmediate(ViewUniformShaderParameters, UniformBuffer_SingleFrame);
PassParameters->View = ViewUniformBuffer;
auto GroupCount = FComputeShaderUtils::GetGroupCount(FIntVector(Params.X, Params.Y, Params.Z), FComputeShaderUtils::kGolden2DGroupSize);
GraphBuilder.AddPass(
RDG_EVENT_NAME("ExecuteMyMaterial3"),
PassParameters,
ERDGPassFlags::AsyncCompute,
[&PassParameters, ComputeShader, MaterialRenderProxy, MaterialResource, LocalScene, GroupCount](FRHIComputeCommandList& RHICmdList)
{
FMeshPassProcessorRenderState DrawRenderState;
MaterialRenderProxy->UpdateUniformExpressionCacheIfNeeded(LocalScene->GetFeatureLevel());
FMeshMaterialShaderElementData ShaderElementData;
FMeshProcessorShaders PassShaders;
PassShaders.ComputeShader = ComputeShader;
FMeshDrawShaderBindings ShaderBindings;
ShaderBindings.Initialize(PassShaders);
int32 DataOffset = 0;
FMeshDrawSingleShaderBindings SingleShaderBindings = ShaderBindings.GetSingleShaderBindings(SF_Compute, DataOffset);
ComputeShader->GetShaderBindings(LocalScene->GetRenderScene(), LocalScene->GetFeatureLevel(), nullptr, *MaterialRenderProxy, *MaterialResource, DrawRenderState, ShaderElementData, SingleShaderBindings);
ShaderBindings.Finalize(&PassShaders);
UE::MeshPassUtils::Dispatch(RHICmdList, ComputeShader, ShaderBindings, *PassParameters, GroupCount);
}); If you're still getting errors with I'd try regenerating. |
Hi, first of all thanks for replying this quickly! #include "MaterialDomain.h" at the top and then got the project to compile. bool bIsShaderValid = ComputeShader.IsValid(); So that's how my little adventure ended on this tutorial. Just to be sure, I also downloaded pure "Bare-bones material graph evaluation via Compute Shader in UE5" (also cleaned the plugins etc, basically clean install from console as well). |
replace the code in ExampleComputeShader.cpp
there was a "!" missing which prevents the shader to be compiled |
Hi,
I just started learning compute shaders in unreal and wanted to follow your Recipe "Making a custom Advanced Output material expression accessible from Compute Shaders in Unreal Engine 5"
When I generate AdvancedOutputComputeShader.cpp I end up with errors on lines 168 and 185
DrawRenderState.SetViewUniformBuffer(ViewUniformBuffer);
RHICmdList.SetComputeShader(ComputeShaderRHI);
Both of those funtions have been depracated after 5.1 and I don't know where to begin with updating those for 5.3. Can you please help?
The text was updated successfully, but these errors were encountered: