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

Ensure PxSomeFlag::Enum is passed correctly #3

Open
PathogenDavid opened this issue Sep 10, 2020 · 0 comments
Open

Ensure PxSomeFlag::Enum is passed correctly #3

PathogenDavid opened this issue Sep 10, 2020 · 0 comments

Comments

@PathogenDavid
Copy link
Member

PathogenDavid commented Sep 10, 2020

PxFlags are translated as [Flags]-style C# enums. This works perfectly for the most part, but there are some places in PhysX where the underlying enum type is referenced directly. (IE: Referring to PxSomeFlag::Enum instead of the PxFlags<PxSomeFlag::Enum, PxU8> type.)

This could be problematic when sizeof(PxFlags<PxSomeFlag::Enum, PxU8>) != sizeof(PxSomeFlag::Enum) (which is generally always when the second template argument isn't 32 bits.) In theory the enum values will always just go into a register anyway, but I need to double check this doesn't cause subtle issues.

It may be easier to just leave this issue to MochiLibraries/Biohazrd#32 since it probably depends on the target platform (and maybe even the target compiler.)

Can [MarshalAs] be used to coerce the enum in these scenarios?

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

1 participant