How can I use a dynamic 2D texture with a plugin?

I created a wikipage containing multiple solutions to this problem, the most performant one is first and lets you update subregions of the texture using ENQUEUE_UNIQUE_RENDER_COMMAND