Esempio n. 1
0
        public static int SizeOfMarshalDirect(this VkDebugReportCallbackCreateInfoEXT s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect());
        }
Esempio n. 2
0
        public static VkDebugReportCallbackCreateInfoEXT.Raw *MarshalIndirect(this VkDebugReportCallbackCreateInfoEXT s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkDebugReportCallbackCreateInfoEXT.Raw *) 0);
            }
            var result = (VkDebugReportCallbackCreateInfoEXT.Raw *)unmanaged;

            unmanaged += VkDebugReportCallbackCreateInfoEXT.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
Esempio n. 3
0
        public static VkDebugReportCallbackCreateInfoEXT.Raw MarshalDirect(this VkDebugReportCallbackCreateInfoEXT s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext = s.Next.MarshalIndirect(ref unmanaged);

            VkDebugReportCallbackCreateInfoEXT.Raw result;
            result.sType       = VkStructureType.DebugReportCallbackCreateInfoEXT;
            result.pNext       = pNext;
            result.flags       = s.Flags;
            result.pfnCallback = Marshal.GetFunctionPointerForDelegate(s.Callback);
            result.pUserData   = (void *)s.UserData;
            return(result);
        }
Esempio n. 4
0
 public static int SizeOfMarshalIndirect(this VkDebugReportCallbackCreateInfoEXT s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkDebugReportCallbackCreateInfoEXT.Raw.SizeInBytes;
Esempio n. 5
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));
            }
        }