Exemplo n.º 1
0
 private (VkAttachmentDescription, VkAttachmentReference) CreateAttachment(
     VkFormat format,
     VkSampleCountFlags samples,
     uint index,
     VkAttachmentLoadOp loadOp,
     VkAttachmentStoreOp storeOp,
     VkAttachmentStoreOp stencilStoreOp,
     VkImageLayout initialLayout,
     VkImageLayout finalLayout)
 {
     return(new VkAttachmentDescription()
     {
         format = format,
         samples = samples,
         loadOp = loadOp,
         storeOp = storeOp,
         stencilLoadOp = VkAttachmentLoadOp.Load,
         stencilStoreOp = stencilStoreOp,
         initialLayout = initialLayout,
         finalLayout = finalLayout
     }, new VkAttachmentReference()
     {
         attachment = index,
         layout = finalLayout
     });
 }
Exemplo n.º 2
0
 /// <summary>
 /// Specifies the store operation of this attachment.
 /// </summary>
 /// <param name="op">Store operation</param>
 /// <param name="stencilOp">Stencil store operation, or null if use <c>op</c></param>
 /// <returns>this</returns>
 public TBuilder StoreOp(VkAttachmentStoreOp op, VkAttachmentStoreOp?stencilOp = null)
 {
     if (!stencilOp.HasValue)
     {
         stencilOp = op;
     }
     _desc.StoreOp        = op;
     _desc.StencilStoreOp = stencilOp.Value;
     return((TBuilder)this);
 }
 /// <summary>
 /// VkAttachmentDescription - Structure specifying an attachment description.
 /// </summary>
 /// <param name="format">format is a VkFormat value specifying the format of the
 /// image view that will be used for the attachment</param>
 /// <param name="samples">samples is the number of samples of the image as defined in
 /// VkSampleCountFlagBits</param>
 /// <param name="loadOp">loadOp is a VkAttachmentLoadOp value specifying how the
 /// contents of color and depth components of the attachment are treated at
 /// the beginning of the subpass where it is first used</param>
 /// <param name="storeOp">storeOp is a VkAttachmentStoreOp value specifying how the
 /// contents of color and depth components of the attachment are treated at
 /// the end of the subpass where it is last used</param>
 /// <param name="stencilLoadOp">stencilLoadOp is a VkAttachmentLoadOp value specifying how
 /// the contents of stencil components of the attachment are treated at the
 /// beginning of the subpass where it is first used</param>
 /// <param name="stencilStoreOp">stencilStoreOp is a VkAttachmentStoreOp value specifying how
 /// the contents of stencil components of the attachment are treated at the
 /// end of the last subpass where it is used</param>
 /// <param name="initialLayout">initialLayout is the layout the attachment image subresource will
 /// be in when a render pass instance begins</param>
 /// <param name="finalLayout">finalLayout is the layout the attachment image subresource will be
 /// transitioned to when a render pass instance ends</param>
 /// <param name="flags">flags is a bitmask of VkAttachmentDescriptionFlagBits
 /// specifying additional properties of the attachment</param>
 public VkAttachmentDescription(VkFormat format, VkSampleCountFlagBits samples,
                                VkAttachmentLoadOp loadOp, VkAttachmentStoreOp storeOp,
                                VkAttachmentLoadOp stencilLoadOp, VkAttachmentStoreOp stencilStoreOp,
                                VkImageLayout initialLayout, VkImageLayout finalLayout,
                                VkAttachmentDescriptionFlagBits flags = 0)
 {
     this.format        = format; this.samples = samples;
     this.loadOp        = loadOp; this.storeOp = storeOp;
     this.stencilLoadOp = stencilLoadOp; this.stencilStoreOp = stencilStoreOp;
     this.initialLayout = initialLayout; this.finalLayout = finalLayout;
     this.flags         = flags;
 }
Exemplo n.º 4
0
 public void AddAttachment(VkFormat format,
                           VkImageLayout finalLayout, VkSampleCountFlags samples = VkSampleCountFlags.SampleCount1,
                           VkAttachmentLoadOp loadOp   = VkAttachmentLoadOp.Clear,
                           VkAttachmentStoreOp storeOp = VkAttachmentStoreOp.Store,
                           VkImageLayout initialLayout = VkImageLayout.Undefined)
 {
     attachments.Add(new VkAttachmentDescription {
         format         = format,
         samples        = samples,
         loadOp         = loadOp,
         storeOp        = storeOp,
         stencilLoadOp  = VkAttachmentLoadOp.DontCare,
         stencilStoreOp = VkAttachmentStoreOp.DontCare,
         initialLayout  = initialLayout,
         finalLayout    = finalLayout,
     });
 }
Exemplo n.º 5
0
 public VkAttachmentDescription(
     VkFormat format,
     VkSampleCountFlags samples         = VkSampleCountFlags.Count1,
     VkAttachmentLoadOp loadOp          = VkAttachmentLoadOp.Clear,
     VkAttachmentStoreOp storeOp        = VkAttachmentStoreOp.Store,
     VkAttachmentLoadOp stencilLoadOp   = VkAttachmentLoadOp.DontCare,
     VkAttachmentStoreOp stencilStoreOp = VkAttachmentStoreOp.DontCare,
     VkImageLayout initialLayout        = VkImageLayout.Undefined,
     VkImageLayout finalLayout          = VkImageLayout.PresentSrcKHR,
     VkAttachmentDescriptionFlags flags = VkAttachmentDescriptionFlags.None)
 {
     this.flags          = flags;
     this.format         = format;
     this.samples        = samples;
     this.loadOp         = loadOp;
     this.storeOp        = storeOp;
     this.stencilLoadOp  = stencilLoadOp;
     this.stencilStoreOp = stencilStoreOp;
     this.initialLayout  = initialLayout;
     this.finalLayout    = finalLayout;
 }