示例#1
0
        public static int SizeOfMarshalDirect(this VkRenderPassBeginInfo s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect() +
                 s.ClearValues.SizeOfMarshalDirect());
        }
示例#2
0
        public static VkRenderPassBeginInfo.Raw *MarshalIndirect(this VkRenderPassBeginInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkRenderPassBeginInfo.Raw *) 0);
            }
            var result = (VkRenderPassBeginInfo.Raw *)unmanaged;

            unmanaged += VkRenderPassBeginInfo.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
示例#3
0
        public void CmdBeginRenderPass(VkRenderPassBeginInfo renderPassBegin, VkSubpassContents contents)
        {
            var unmanagedSize =
                renderPassBegin.SizeOfMarshalIndirect();
            var unmanagedArray = new byte[unmanagedSize];

            fixed(byte *unmanagedStart = unmanagedArray)
            {
                var unmanaged         = unmanagedStart;
                var _commandBuffer    = Handle;
                var _pRenderPassBegin = renderPassBegin.MarshalIndirect(ref unmanaged);
                var _contents         = contents;

                Direct.CmdBeginRenderPass(_commandBuffer, _pRenderPassBegin, _contents);
            }
        }
示例#4
0
        public static VkRenderPassBeginInfo.Raw MarshalDirect(this VkRenderPassBeginInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext        = s.Next.MarshalIndirect(ref unmanaged);
            var pClearValues = s.ClearValues.MarshalDirect(ref unmanaged);

            VkRenderPassBeginInfo.Raw result;
            result.sType           = VkStructureType.RenderPassBeginInfo;
            result.pNext           = pNext;
            result.renderPass      = s.RenderPass?.Handle ?? VkRenderPass.HandleType.Null;
            result.framebuffer     = s.Framebuffer?.Handle ?? VkFramebuffer.HandleType.Null;
            result.renderArea      = s.RenderArea;
            result.clearValueCount = s.ClearValues?.Count ?? 0;
            result.pClearValues    = pClearValues;
            return(result);
        }
示例#5
0
 public static int SizeOfMarshalIndirect(this VkRenderPassBeginInfo s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkRenderPassBeginInfo.Raw.SizeInBytes;
示例#6
0
 public void CmdBeginRenderPass(VkRenderPassBeginInfo renderPassBegin, VkSubpassContents contents)
 {
     var unmanagedSize =
         renderPassBegin.SizeOfMarshalIndirect();
     var unmanagedArray = new byte[unmanagedSize];
     fixed (byte* unmanagedStart = unmanagedArray)
     {
         var unmanaged = unmanagedStart;
         var _commandBuffer = Handle;
         var _pRenderPassBegin = renderPassBegin.MarshalIndirect(ref unmanaged);
         var _contents = contents;
         Direct.CmdBeginRenderPass(_commandBuffer, _pRenderPassBegin, _contents);
     }
 }