Пример #1
0
        public Result AllocateCommandBuffers(MgCommandBufferAllocateInfo pAllocateInfo, IMgCommandBuffer[] pCommandBuffers)
        {
            var cmdPool = pAllocateInfo.CommandPool as GLCommandPool;

            if (cmdPool == null)
            {
                throw new InvalidCastException("pAllocateInfo.CommandPool");
            }

            for (uint i = 0; i < pAllocateInfo.CommandBufferCount; ++i)
            {
                // TODO : for now
                var sorter   = new GLCmdIncrementalContextSorter();
                var dsBinder = new GLNextDescriptorSetBinder();
                var graphics = new GLCmdGraphicsEncoder(sorter, new GLCmdGraphicsBag(), mEntrypoint.VBO, dsBinder);
                var compute  = new GLCmdComputeEncoder();
                var blit     = new GLCmdBlitEncoder(sorter, new GLCmdBlitBag());
                var encoder  = new GLCmdCommandEncoder(sorter, graphics, compute, blit);


                var buffer = new GLCmdCommandBuffer(true, encoder);
                cmdPool.Buffers.Add(buffer);
                pCommandBuffers [i] = buffer;
            }

            return(Result.SUCCESS);
        }
Пример #2
0
 public GLCmdCommandBuffer(bool canBeManuallyReset, GLCmdCommandEncoder encoder)
 {
     mIsRecording        = false;
     mIsExecutable       = false;
     mManuallyResettable = canBeManuallyReset;
     mCommandEncoder     = encoder;
 }