Godot Version
4.4.1
Question
I’m trying to figure out how to use compute shaders to make a shader pipeline, and am running into issues with the main rendering device vs local rendering devices. Since this is a pipeline, I have several shaders which each perform a unit of processing on image buffers. So I need to use the output of one as the input of another, which means making sure that one shader pipeline has finished its computation before staring the next. (I’m using Texture2DRD images created from the server to hold the buffer data.)
If I compute on the main rendering device I get from RenderingServer.get_rendering_device(), then I am not able to call rd.submit() or rd_sync(), which I need to do to ensure that the shader has finished. On the other hand, if I create a rendering device by calling RenderingServer.create_local_rendering_device(), then none of the Texture2DRD that I create from the device can be used to draw onscreen.
I need to either find a way to add a memory barrier to the main rendering device, or find a way to use textures created on a local rendering server in the main thread (eg, assign it to a TextureMap.texture). Can I do this?