Modifying texture from different thread & updateResource

Currently I have a texture I often modify, in a different thread. Locking/unlocking it for writing works, but if i call the “updateResource” method, while in that different thread, I get an exception saying something along the line, that the call is not from the redenderer thread.

If I modify the texture on a separate thread & do the updateResource call on the main game thread, it works.

My questions are:

  • how often should I call
    updateResource? in some situations I
    only call it once, and them modify
    the texture as many times as I want,
    in the game it still works.
  • is there any way to actually call the method from my main separate thread?

Have you found a solution to this? I have the same issue where I receive UDP packages and update a texture with data from that UDP package but I cant update the resources without an exception being raised…

If you find a solution let me know!

Kind regards

I find it pretty awkward as well… since the texture data supports locking out of the box, why can’t we update resource from a different thread ?!

The only thing left is to update resource on a main thread with lot of hopes that it won’t stall the game thread too much…

Probably reducing texture size is the way to go if the game thread is around to choke up :frowning: