RenderBufferApi::update_buffer completion?

RenderBufferApi::update_buffer completion?

Anonymous
Not applicable
623 Views
2 Replies
Message 1 of 3

RenderBufferApi::update_buffer completion?

Anonymous
Not applicable

Hello,

 

I'm using the Plugin API's RenderBufferApi to dynamically update a texture. So for this I'm using the update_buffer function.

 

It seems to me that this function completes asynchronously. 

 

Which leads me to my question, how do I know when this method call has completed?

 

How do I know when it's safe to access the buffer again on my side? Specifically,  delete it or update it?

 

Peeking into the engine source  it looks like I can use the RenderInterfaceApi::create_fence and wait_for_fence for this. Is that correct?

 

 

Thanks

 

 

 

 

Reply
Reply
0 Likes
624 Views
2 Replies
Replies (2)
Message 2 of 3

__ben__
Alumni
Alumni

As best I can tell the update_buffer() function completes synchronously. It should be called during the update portion of the game loop. As long as the contents of the buffer have settled by the end of the update segment, rendering will proceed normally.

 

Two code examples that demonstrate use of update_buffer() can be found here:

 

https://help.autodesk.com/view/Stingray/ENU/?guid=__lua_ref_exa_ex__snippets_proc__meshes_html

https://github.com/AutodeskGames/stingray-plugin/wiki/How-to-create-a-cool-plugin

Reply
Reply
0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi, that really doesn't sound true. In a threaded engine mode, it seems that the the request is really put into a message buffer and then performed on another thread. (see RenderInterface::dispatch, RenderInterface::post_message)

 

Also it seems that the RenderInterfaceApi::create_fence and RenderInterfaceApi::wait_for_fence really are the things that I want.

 

Thanks.

Reply
Reply
0 Likes