Example #1
0
        public VkObjectResult <IVkDebugReportCallbackEXT> CreateDebugReportCallbackEXT(VkDebugReportCallbackCreateInfoEXT createInfo, IVkAllocationCallbacks allocator)
        {
            var unmanagedSize =
                createInfo.SizeOfMarshalIndirect() +
                allocator.SizeOfMarshalIndirect();
            var unmanagedArray = new byte[unmanagedSize];

            fixed(byte *unmanagedStart = unmanagedArray)
            {
                var unmanaged   = unmanagedStart;
                var pCreateInfo = createInfo.MarshalIndirect(ref unmanaged);
                var pAllocator  = allocator.MarshalIndirect(ref unmanaged);

                VkDebugReportCallbackEXT.HandleType callbackHandle;
                var result   = Direct.CreateDebugReportCallbackEXT(Handle, pCreateInfo, pAllocator, &callbackHandle);
                var instance = result == VkResult.Success ? new VkDebugReportCallbackEXT(this, callbackHandle, allocator) : null;

                return(new VkObjectResult <IVkDebugReportCallbackEXT>(result, instance));
            }
        }