Skip to content

Problem marshalling with Unmanaged.LPUTF8Str #52810

Answered by jkoritzinsky
msedi asked this question in Q&A
Discussion options

You must be logged in to vote

The difference between ByValTStr and LPUTF8Str is where the string is placed in memory.

For the ByValTStr case, the native representation of the VkPhysicalDeviceProperties struct would look like the following:

    struct VkPhysicalDeviceProperties
    {
        VulkanVersion ApiVersion;
        VulkanVersion DriverVersion;
        int VendorId;
        int DeviceId;
        VkPhysicalDeviceType DeviceType;
        char DeviceName[MaxPhysicalDeviceNameSize]; // Marshalled in-place in the structure
        GUID PipelineCacheUuid;
        VkPhysicalDeviceLimits Limits;
        VkPhysicalDeviceSparseProperties SparseProperties;
    };

For the LPUTF8Str case, the string is marshalled as a poin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@msedi
Comment options

Answer selected by msedi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants