Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in SDK Guide and API reference about completion tasks #612

Open
zopsicle opened this issue Nov 6, 2022 · 2 comments
Open

Discrepancy in SDK Guide and API reference about completion tasks #612

zopsicle opened this issue Nov 6, 2022 · 2 comments

Comments

@zopsicle
Copy link

zopsicle commented Nov 6, 2022

The SDK Guide says:

A completion task is a task that executes immediately after PxScene::simulate has exited. If PhysX has been configured to use worker threads then PxScene::simulate will start simulation tasks on the worker threads and will likely exit before the worker threads have completed the work necessary to complete the scene update. […] As a consequence, a typical completion task would first need to call PxScene::fetchResults(true) to ensure that fetchResults blocks until all worker threads started during simulate() have completed their work.

I.e. the completion task is submitted just before simulate returns. (This would also mean that completion tasks are a redundant feature, as the caller could just submit the task themselves after simulate returns.)


The API reference says:

if non-NULL, this task will have its refcount incremented in simulate(), then decremented when the scene is ready to have fetchResults called. So the task will not run until the application also calls removeReference().

I.e. the completion task is not submitted before all the simulation tasks have finished. (This behavior seems actually useful, as it permits asynchronous use of the API without any blocking.)


It seems to me that the SDK Guide and the API reference disagree about when completion tasks are submitted. I guess the API reference here is correct?

@zopsicle zopsicle changed the title Discrepancy in SDK Guied and API reference about completion tasks Discrepancy in SDK Guide and API reference about completion tasks Nov 6, 2022
@msauter-nvidia
Copy link

The API documentation is correct. The text in the guide is misleading and needs some clarification. Thanks for the feedback.

@zopsicle
Copy link
Author

zopsicle commented Nov 8, 2022

Seems to have been fixed in the documentation for PhysX 5: https://nvidia-omniverse.github.io/PhysX/physx/5.1.0/docs/Simulation.html#completion-tasks. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants