Choosing global vs local rendering device

Godot Version

4.4.1

Question

I’m learning compute shaders and want to use them to generate images that will then be used in later parts of my shading pipeline. I feel I need to use compute shaders for this since the textures I’m trying to create are much to slow to compute with GDScript and using regular shaders with Viewports is very restrictive.

I’m confused as to whether I should be calling things on the global render thread, or if I should be creating an offscreen local RenderingDevice. Some of these textures only need to be generated once so I think a local device makes sense for that - but then I want to use the generated texture later in the pipeline.

Can I create a Texture2DRD that uses the results from a local rendering device, and then use that texture in the global rendering thread? Would I need to maybe copy it to a regular Image if I wanted to use it later in a different thread? Would it make sense to just do everything in the rendering thread, even if it’s just generating a cached image?

One thing im not certain about is if you build your compute mechanism on the global rendering device will it then be computed over and over until you clean up the mechanism.

I think that kind of sounds like you want to use the compositor. But it really depends on what your texture will be used for. You can setup some global shader parameters that can be updated with the results of your compute to be used by some mesh/canvas material instances.