/// <summary> /// Submits semaphores or a command buffer to a queue. /// </summary> /// <param name="fence"> /// An optional handle to a fence to be signaled. If fence is not <c>null</c>, it defines a /// fence signal operation. /// </param> /// <param name="waitSemaphore"> /// Semaphore upon which to wait before the command buffer for this batch begins execution. /// If semaphore to wait on is provided, it defines a semaphore wait operation. /// </param> /// <param name="waitDstStageMask">Pipeline stages at which semaphore wait will occur.</param> /// <param name="commandBuffer">Command buffer to execute in the batch.</param> /// <param name="signalSemaphore"> /// Semaphore which will be signaled when the command buffer for this batch has completed /// execution. If semaphore to be signaled is provided, it defines a semaphore signal operation. /// </param> /// <exception cref="VulkanException">Vulkan returns an error code.</exception> public void Submit(Semaphore waitSemaphore, PipelineStages waitDstStageMask, CommandBuffer commandBuffer, Semaphore signalSemaphore, Fence fence = null) { long waitSemaphoreHandle = waitSemaphore; IntPtr commandBufferHandle = commandBuffer; long signalSemaphoreHandle = signalSemaphore; var nativeSubmit = new SubmitInfo.Native { Type = StructureType.SubmitInfo }; if (waitSemaphoreHandle != 0) { nativeSubmit.WaitSemaphoreCount = 1; nativeSubmit.WaitSemaphores = new IntPtr(&waitSemaphoreHandle); nativeSubmit.WaitDstStageMask = new IntPtr(&waitDstStageMask); } if (commandBufferHandle != IntPtr.Zero) { nativeSubmit.CommandBufferCount = 1; nativeSubmit.CommandBuffers = new IntPtr(&commandBufferHandle); } if (signalSemaphoreHandle != 0) { nativeSubmit.SignalSemaphoreCount = 1; nativeSubmit.SignalSemaphores = new IntPtr(&signalSemaphoreHandle); } Result result = vkQueueSubmit(this, 1, &nativeSubmit, fence); VulkanException.ThrowForInvalidResult(result); }
public InstanceRendererEffect( string name, Graphics graphics, ImageLayout finalLayout, Accesses finalAccess, PipelineStages finalStage, ImageLayout initialLayout = ImageLayout.Undefined, Accesses initialAccess = Accesses.None, PipelineStages initialStage = PipelineStages.TopOfPipe ) : base(name, graphics, finalLayout, finalAccess, finalStage, initialLayout, initialAccess, initialStage) { }
public SpriteEffect(Graphics graphics, RenderPassObject renderPass, int maxSprites, ImageLayout initialLayout, Accesses initialAccess, PipelineStages initialStage) : base( nameof(SpriteEffect), graphics, ImageLayout.ColorAttachmentOptimal, Accesses.ColorAttachmentWrite, PipelineStages.ColorAttachmentOutput, initialLayout, initialAccess, initialStage ) { RenderPass = renderPass; MaxSprites = maxSprites; }
public TriangleTestEffect(Graphics graphics, RenderPassObject renderPass, Texture2D texture, ImageLayout initialLayout, Accesses initialAccess, PipelineStages initialStage) : base( nameof(TriangleTestEffect), graphics, ImageLayout.ColorAttachmentOptimal, Accesses.ColorAttachmentWrite, PipelineStages.ColorAttachmentOutput, initialLayout, initialAccess, initialStage ) { RenderPass = renderPass; Texture = texture; }
public TransitionEffect( Graphics graphics, ImageLayout initialLayout, Accesses initialAccess, PipelineStages initialStage, ImageLayout finalLayout, Accesses finalAccess, PipelineStages finalStage ) : base( nameof(TransitionEffect), graphics, finalLayout, finalAccess, finalStage, initialLayout, initialAccess, initialStage ) { }
public ImageEffect( string name, Graphics graphics, ImageLayout finalLayout, Accesses finalAccess, PipelineStages finalStage, ImageLayout initialLayout = ImageLayout.Undefined, Accesses initialAccess = Accesses.None, PipelineStages initialStage = PipelineStages.TopOfPipe ) { Name = name; Graphics = graphics; InitialLayout = initialLayout; InitialAccess = initialAccess; InitialStage = initialStage; FinalLayout = finalLayout; FinalAccess = finalAccess; FinalStage = finalStage; }
/// <summary> /// Initializes a new instance of the <see cref="SubpassDependency"/> structure. /// </summary> /// <param name="srcSubpass"> /// The subpass index of the first subpass in the dependency, or <see cref="Constant.SubpassExternal"/>. /// </param> /// <param name="dstSubpass"> /// The subpass index of the second subpass in the dependency, or <see cref="Constant.SubpassExternal"/>. /// </param> /// <param name="srcStageMask">Specifies a source stage mask.</param> /// <param name="dstStageMask">Specifies a destination stage mask.</param> /// <param name="srcAccessMask">Specifies a source access mask.</param> /// <param name="dstAccessMask">Specifies a destination access mask.</param> /// <param name="dependencyFlags">A bitmask of <see cref="Dependencies"/>.</param> public SubpassDependency( int srcSubpass, int dstSubpass, PipelineStages srcStageMask, PipelineStages dstStageMask, Accesses srcAccessMask, Accesses dstAccessMask, Dependencies dependencyFlags = Dependencies.None) { SrcSubpass = srcSubpass; DstSubpass = dstSubpass; SrcStageMask = srcStageMask; DstStageMask = dstStageMask; SrcAccessMask = srcAccessMask; DstAccessMask = dstAccessMask; DependencyFlags = dependencyFlags; }
/// <summary> /// Execute a pipelined write of a marker value into a buffer. /// </summary> /// <param name="commandBuffer">The command buffer into which the command will be recorded.</param> /// <param name="pipelineStage">Specifies the pipeline stage whose completion triggers the marker write.</param> /// <param name="dstBuffer">The buffer where the marker will be written to.</param> /// <param name="dstOffset">The byte offset into the buffer where the marker will be written to.</param> /// <param name="marker">The 32-bit value of the marker.</param> public static void CmdWriteBufferMarkerAmd(this CommandBuffer commandBuffer, PipelineStages pipelineStage, Buffer dstBuffer, long dstOffset, int marker) { vkCmdWriteBufferMarkerAMD(commandBuffer)(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker); }
public PipelineStage GetStage(PipelineStages stage) { return(GetStage("__PipelineEntry")); }
public PipelineStage GetStage(PipelineStages stage) { return GetStage("__PipelineEntry"); }