public override void Begin() { if (_commandBufferBegun) { throw new VeldridException( "CommandList must be in its initial state, or End() must have been called, for Begin() to be valid to call."); } if (_commandBufferEnded) { _commandBufferEnded = false; _cb = GetNextCommandBuffer(); if (_currentStagingInfo != null) { RecycleStagingInfo(_currentStagingInfo); } } _currentStagingInfo = GetStagingResourceInfo(); VkCommandBufferBeginInfo beginInfo = VkCommandBufferBeginInfo.New(); beginInfo.flags = VkCommandBufferUsageFlags.OneTimeSubmit; vkBeginCommandBuffer(_cb, ref beginInfo); _commandBufferBegun = true; ClearCachedState(); _currentFramebuffer = null; _currentGraphicsPipeline = null; Util.ClearArray(_currentGraphicsResourceSets); Util.ClearArray(_scissorRects); _currentComputePipeline = null; Util.ClearArray(_currentComputeResourceSets); }
public void CommandBufferSubmitted(VkCommandBuffer cb) { SubmittedCommandBufferCount += 1; _submittedStagingInfos.Add(cb, _currentStagingInfo); _currentStagingInfo = null; }