internal VulkanGraphicsContext(VulkanGraphicsDevice device, int index) : base(device, index) { _fence = new VulkanGraphicsFence(device); _waitForExecuteCompletionFence = new VulkanGraphicsFence(device); _vulkanCommandBuffer = new ValueLazy <VkCommandBuffer>(CreateVulkanCommandBuffer); _vulkanCommandPool = new ValueLazy <VkCommandPool>(CreateVulkanCommandPool); _vulkanFramebuffer = new ValueLazy <VkFramebuffer>(CreateVulkanFramebuffer); _vulkanSwapChainImageView = new ValueLazy <VkImageView>(CreateVulkanSwapChainImageView); _ = _state.Transition(to: Initialized); }
internal VulkanGraphicsDevice(VulkanGraphicsAdapter adapter, IGraphicsSurface surface, int contextCount) : base(adapter, surface) { _presentCompletionFence = new VulkanGraphicsFence(this); _vulkanCommandQueue = new ValueLazy <VkQueue>(GetVulkanCommandQueue); _vulkanCommandQueueFamilyIndex = new ValueLazy <uint>(GetVulkanCommandQueueFamilyIndex); _vulkanDevice = new ValueLazy <VkDevice>(CreateVulkanDevice); _vulkanRenderPass = new ValueLazy <VkRenderPass>(CreateVulkanRenderPass); _vulkanSurface = new ValueLazy <VkSurfaceKHR>(CreateVulkanSurface); _vulkanSwapchain = new ValueLazy <VkSwapchainKHR>(CreateVulkanSwapchain); _vulkanSwapchainImages = new ValueLazy <VkImage[]>(GetVulkanSwapchainImages); _memoryAllocator = new ValueLazy <VulkanGraphicsMemoryAllocator>(CreateMemoryAllocator); _contexts = CreateGraphicsContexts(this, contextCount); _ = _state.Transition(to: Initialized); PresentCompletionFence.Reset(); surface.SizeChanged += OnGraphicsSurfaceSizeChanged;