Page 1 of 1

[2.1] access workspace in HlmsListener's preparePassBuffer

Posted: Fri Nov 16, 2018 5:03 am
by rujialiu
Hi!

I added some additional infomation in PassBuffer via HlmsListener's preparePassBuffer() function. It works, but I need to write different information for different workspaces. I don't think I can distinguish workspaces in my app's logic because those workspaces are executed in the same frame (e.g. one for displaying, one for background video recording but with a different camera).

Ideally, I need to read a unique identifier of the workspace (is there any?), but if I can't distinguish all workspaces for the same WorkspaceDef, it's ok to read workspacedef's name in preparePassBuffer(), because I can duplicate the workspacedef in the .compositor file, and use different workspacedefs when creating those workspaces.

What is the recommended way to do this? Thanks!

Re: [2.1] access workspace in HlmsListener's preparePassBuffer

Posted: Fri Nov 16, 2018 5:56 am
by dark_sylinc
You should have access to CompositorPass via SceneManager::getCurrentCompositorPass.
From there you should be able to obtain everything (ie. parent pointers, associated definition, etc).

Cheers

Re: [2.1] access workspace in HlmsListener's preparePassBuffer

Posted: Fri Nov 16, 2018 6:37 am
by rujialiu
dark_sylinc wrote:
Fri Nov 16, 2018 5:56 am
You should have access to CompositorPass via SceneManager::getCurrentCompositorPass.
From there you should be able to obtain everything (ie. parent pointers, associated definition, etc).
Thanks!