diff options
author | Juan Linietsky <reduzio@gmail.com> | 2023-07-20 11:49:59 +0200 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2023-07-26 12:28:00 +0200 |
commit | c7fb6cea3d745c6d06d26b99e083f3fdf3cd7e8b (patch) | |
tree | b9675e2fe517885faa17dc5da36af42af79efe47 /modules/gdscript/gdscript_parser.cpp | |
parent | 202e4b2c1e7f8b25738b93d0e4d5066453d3edf3 (diff) | |
download | redot-engine-c7fb6cea3d745c6d06d26b99e083f3fdf3cd7e8b.tar.gz |
Add ability to call code on rendering thread
As more users use compute in Godot 4, the way they do is most likely incompatible when running
on separate threads and will start erroring soon as we improve the thread safety of the render thread.
To properly run code on the render thread, this function was added. Use like this:
```GDScript
func initialize_compute_code():
....
func update_compute_code(custom_data):
...
func _ready():
RenderingServer.call_on_render_thread( initialize_compute_code )
func _process():
RenderingServer.call_on_render_thread( update_compute_code.bind(with_data) )
```
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
0 files changed, 0 insertions, 0 deletions