Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.4, 6.5.2
-
None
Description
The compute shaders always run, even if there are no changes. This is causing issues for my project, as the compute shader always running means other shaders (vertex, etc) that use buffers or textures updated by the compute shader will run too, even if there has been no change to the data.
I am using the OpenGL backend, but it looks like this might affect the RHI backend too.
I have traced what I believe the root cause to be found at this line in the OpenGL renderer: https://code.qt.io/cgit/qt/qt3d.git/tree/src/plugins/renderers/opengl/renderer/renderer.cpp?h=6.5.2#n2003
And in the RHI renderer: https://code.qt.io/cgit/qt/qt3d.git/tree/src/plugins/renderers/rhi/renderer/renderer.cpp?h=6.5.2#n2401
Setting the compute shader to dirty, after performing compute, was a hack introduced in 7e2f9d42eebe13182918d832577c4f5ed96ab87b. Is this hack still applicable, does the computer shader dirty bit get set by the ComputeJob nodes?
In my quick, limited testing, removing that line didn't seem to break anything. The compute shaders would run when parameters or textures changed, as you'd expect, and didn't constantly run when the render policy was set to OnDemand.