classes/class_renderingdevice #356
Replies: 2 comments 4 replies
-
| I made an example on using the RenderingDevice and draw_list to build a customized pipeline and output the result to screen. | 
Beta Was this translation helpful? Give feedback.
-
| If you want to run a compute shader in a separate thread by using local rendering devices (to be able to use  
 the trick is to create the texture in the main thread and share it with the compute thread for updating: ## main thread
var rd := RenderingServer.get_rendering_device()
var fmt : RDTextureFormat = ...
var view : RDTextureView = ...
var texture := rd.texture_create(fmt, view)
var texture_resource := rd.get_driver_resource(RenderingDevice.DRIVER_RESOURCE_TEXTURE, texture, 0)
# pass `texture_resource` (which is just an integer) to your compute thread...
## compute thread
var rd := RenderingServer.create_local_rendering_device()
# put the resource value in the `image` argument, and other formats should match `fmt` above
var texture := rd.texture_create_from_extension(RenderingDevice.TEXTURE_TYPE_2D, ..., texture_resource, ...)
# now you can write to `texture` here and it will be reflected on the main thread after `submit()`! | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
classes/class_renderingdevice
Inherits: Object Abstraction for working with modern low-level graphics APIs. Description: RenderingDevice is an abstraction for working with modern low-level graphics APIs such as Vulkan. Compared...
https://docs.godotengine.org/en/stable/classes/class_renderingdevice.html
Beta Was this translation helpful? Give feedback.
All reactions