public static unsafe VkAllocationCallbacks.Raw *MarshalIndirect(this IVkAllocationCallbacks s, ref byte *unmanaged) { if (s == null) { return((VkAllocationCallbacks.Raw *) 0); } var result = (VkAllocationCallbacks.Raw *)unmanaged; unmanaged += VkAllocationCallbacks.Raw.SizeInBytes; result->pUserData = s.UserData; result->pfnAllocation = Marshal.GetFunctionPointerForDelegate(s.Allocation); result->pfnReallocation = Marshal.GetFunctionPointerForDelegate(s.Reallocation); result->pfnFree = Marshal.GetFunctionPointerForDelegate(s.Free); result->pfnInternalAllocation = Marshal.GetFunctionPointerForDelegate(s.InternalAllocation); result->pfnInternalFree = Marshal.GetFunctionPointerForDelegate(s.InternalFree); return(result); }
public VkDeviceMemory(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkPipelineCache(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkObjectResult<IVkDevice> CreateDevice(VkDeviceCreateInfo createInfo, IVkAllocationCallbacks allocator) { var size = createInfo.SizeOfMarshalDirect() + allocator.SizeOfMarshalIndirect(); return VkHelpers.RunWithUnamangedData(size, u => CreateDevice(u, createInfo, allocator)); }
public VkSurfaceKHR(IVkInstance instance, HandleType handle, IVkAllocationCallbacks allocator) { Instance = instance; Handle = handle; Allocator = allocator; }
public VkSwapchainKHR(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkShaderModule(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkImageView(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkCommandPool(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkObjectResult <IVkDisplayModeKHR> CreateDisplayMode(IVkDisplayKHR display, VkDisplayModeCreateInfoKHR createInfo, IVkAllocationCallbacks allocator) { var unmanagedSize = createInfo.SizeOfMarshalIndirect() + allocator.SizeOfMarshalIndirect(); var unmanagedArray = new byte[unmanagedSize]; fixed(byte *unmanagedStart = unmanagedArray) { var unmanaged = unmanagedStart; var displayHandle = display?.Handle ?? VkDisplayKHR.HandleType.Null; var pCreateInfo = createInfo.MarshalIndirect(ref unmanaged); var pAllocator = allocator.MarshalIndirect(ref unmanaged); VkDisplayModeKHR.HandleType displayModeHandle; var result = Direct.CreateDisplayModeKHR(Handle, displayHandle, pCreateInfo, pAllocator, &displayModeHandle); var instance = result == VkResult.Success ? new VkDisplayModeKHR(Instance, displayModeHandle) : null; return(new VkObjectResult <IVkDisplayModeKHR>(result, instance)); } }
private VkObjectResult <IVkDevice> CreateDevice(IntPtr data, VkDeviceCreateInfo createInfo, IVkAllocationCallbacks allocator) { var unmanaged = (byte *)data; var createInfoRaw = createInfo.MarshalDirect(ref unmanaged); var pAllocator = allocator.MarshalIndirect(ref unmanaged); VkDevice.HandleType handle; var result = Direct.CreateDevice(Handle, &createInfoRaw, pAllocator, &handle); var device = result == VkResult.Success ? new VkDevice(this, handle, allocator) : null; return(new VkObjectResult <IVkDevice>(result, device)); }
public VkObjectResult <IVkDevice> CreateDevice(VkDeviceCreateInfo createInfo, IVkAllocationCallbacks allocator) { var size = createInfo.SizeOfMarshalDirect() + allocator.SizeOfMarshalIndirect(); return(VkHelpers.RunWithUnamangedData(size, u => CreateDevice(u, createInfo, allocator))); }
public VkObjectResult<IVkDisplayModeKHR> CreateDisplayMode(IVkDisplayKHR display, VkDisplayModeCreateInfoKHR createInfo, IVkAllocationCallbacks allocator) { var unmanagedSize = createInfo.SizeOfMarshalIndirect() + allocator.SizeOfMarshalIndirect(); var unmanagedArray = new byte[unmanagedSize]; fixed (byte* unmanagedStart = unmanagedArray) { var unmanaged = unmanagedStart; var displayHandle = display?.Handle ?? VkDisplayKHR.HandleType.Null; var pCreateInfo = createInfo.MarshalIndirect(ref unmanaged); var pAllocator = allocator.MarshalIndirect(ref unmanaged); VkDisplayModeKHR.HandleType displayModeHandle; var result = Direct.CreateDisplayModeKHR(Handle, displayHandle, pCreateInfo, pAllocator, &displayModeHandle); var instance = result == VkResult.Success ? new VkDisplayModeKHR(Instance, displayModeHandle) : null; return new VkObjectResult<IVkDisplayModeKHR>(result, instance); } }
private VkObjectResult<IVkDevice> CreateDevice(IntPtr data, VkDeviceCreateInfo createInfo, IVkAllocationCallbacks allocator) { var unmanaged = (byte*)data; var createInfoRaw = createInfo.MarshalDirect(ref unmanaged); var pAllocator = allocator.MarshalIndirect(ref unmanaged); VkDevice.HandleType handle; var result = Direct.CreateDevice(Handle, &createInfoRaw, pAllocator, &handle); var device = result == VkResult.Success ? new VkDevice(this, handle, allocator) : null; return new VkObjectResult<IVkDevice>(result, device); }
public VkPipelineLayout(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkDebugReportCallbackEXT(IVkInstance instance, HandleType handle, IVkAllocationCallbacks allocator) { Instance = instance; Handle = handle; Allocator = allocator; }
public VkObjectResult <IVkSurfaceKHR> CreateDisplayPlaneSurfaceKHR(VkDisplaySurfaceCreateInfoKHR 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); VkSurfaceKHR.HandleType surfaceHandle; var result = Direct.CreateDisplayPlaneSurfaceKHR(Handle, pCreateInfo, pAllocator, &surfaceHandle); var instance = result == VkResult.Success ? new VkSurfaceKHR(this, surfaceHandle, allocator) : null; return(new VkObjectResult <IVkSurfaceKHR>(result, instance)); } }
public VkRenderPass(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
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)); } }
public VkDescriptorPool(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public static int SizeOfMarshalIndirect(this IVkAllocationCallbacks s) => s != null ? VkAllocationCallbacks.Raw.SizeInBytes : 0;
public VkDescriptorSetLayout(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkFramebuffer(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkSampler(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator) { Device = device; Handle = handle; Allocator = allocator; }
public VkObjectResult<IVkSurfaceKHR> CreateDisplayPlaneSurfaceKHR(VkDisplaySurfaceCreateInfoKHR 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); VkSurfaceKHR.HandleType surfaceHandle; var result = Direct.CreateDisplayPlaneSurfaceKHR(Handle, pCreateInfo, pAllocator, &surfaceHandle); var instance = result == VkResult.Success ? new VkSurfaceKHR(this, surfaceHandle, allocator) : null; return new VkObjectResult<IVkSurfaceKHR>(result, instance); } }