Skip to content

Ensure PxSomeFlag::Enum is passed correctly #3

@PathogenDavid

Description

@PathogenDavid

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions