Ejemplo n.º 1
0
        public AmtFramebuffer(MgFramebufferCreateInfo createInfo)
        {
            if (createInfo == null)
            {
                throw new ArgumentNullException(nameof(createInfo));
            }

            if (createInfo.RenderPass == null)
            {
                throw new ArgumentNullException(nameof(createInfo.RenderPass));
            }

            Width  = createInfo.Width;
            Height = createInfo.Height;
            Layers = createInfo.Layers;

            var bRenderpass = (AmtRenderPass)createInfo.RenderPass;

            CompatibilityProfile = bRenderpass.Profile;

            if (createInfo.Attachments != null)
            {
                var noOfSubpasses = bRenderpass.Subpasses.Length;
                Subpasses = new AmtFramebufferSubpassInfo[noOfSubpasses];

                for (var i = 0; i < noOfSubpasses; i++)
                {
                    var srcSubpass = bRenderpass.Subpasses[i];
                    Debug.Assert(srcSubpass.ColorAttachments != null);

                    var noOfColorAttachments = srcSubpass.ColorAttachments.Length;

                    var dstSubpass = new AmtFramebufferSubpassInfo
                    {
                        ColorAttachments = new IAmtImageView[noOfColorAttachments],
                        DepthStencil     = (srcSubpass.DepthStencil != null)
                                                        ? (IAmtImageView)createInfo.Attachments[srcSubpass.DepthStencil.Index]
                                                        : null,
                    };

                    for (var j = 0; j < noOfColorAttachments; ++j)
                    {
                        var imageViewIndex = srcSubpass.ColorAttachments[j].Index;
                        dstSubpass.ColorAttachments[j] = (IAmtImageView)createInfo.Attachments[imageViewIndex];
                    }

                    Subpasses[i] = dstSubpass;
                }
            }
            else
            {
                Subpasses = new AmtFramebufferSubpassInfo[] { };
            }
        }
Ejemplo n.º 2
0
 public Result CreateFramebuffer(MgFramebufferCreateInfo pCreateInfo, IMgAllocationCallbacks allocator, out IMgFramebuffer pFramebuffer)
 {
     // TODO : make sure everything is attached properly
     pFramebuffer = new AmtFramebuffer(pCreateInfo);
     return(Result.SUCCESS);
 }
Ejemplo n.º 3
0
 public Result CreateFramebuffer(MgFramebufferCreateInfo pCreateInfo, IMgAllocationCallbacks allocator, out IMgFramebuffer pFramebuffer)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public Result CreateFramebuffer(MgFramebufferCreateInfo pCreateInfo, IMgAllocationCallbacks allocator, out IMgFramebuffer pFramebuffer)
 {
     pFramebuffer = new GLFramebuffer();
     return(Result.SUCCESS);
 }