Esempio n. 1
0
        public void Render(IGLCommandBuffer buffer)
        {
            if (buffer.IsQueueReady)
            {
                var recording = GenerateRecording(buffer, mRenderer);

                foreach (var context in buffer.Record.Contexts)
                {
                    if (context.Category == GLCmdEncoderCategory.Compute)
                    {
                        recording.Compute.Encoder = new GLCmdComputeEncoder();
                    }
                    else if (context.Category == GLCmdEncoderCategory.Blit)
                    {
                        recording.Blit.Entrypoint = mBlit;
                    }

                    for (var i = context.First; i <= context.Last; ++i)
                    {
                        buffer.Record.Instructions[i].Perform(recording);
                    }

                    if (context.Category == GLCmdEncoderCategory.Compute)
                    {
                        recording.Compute.Encoder.EndEncoding();
                        recording.Compute.Encoder = null;
                    }
                    ////else if (context.Category == AmtEncoderCategory.Blit)
                    ////{
                    ////	recording.Blit.Encoder.EndEncoding();
                    ////	recording.Blit.Encoder = null;
                    ////}
                }
            }
        }
Esempio n. 2
0
 static GLCmdCommandRecording GenerateRecording(IGLCommandBuffer buffer, IGLCmdStateRenderer renderer)
 {
     return(new GLCmdCommandRecording
     {
         Compute = new GLCmdComputeRecording
         {
             Grid = buffer.Record.ComputeGrid,
         },
         Graphics = new GLCmdGraphicsRecording
         {
             StateRenderer = renderer,
             Grid = buffer.Record.GraphicsGrid,
         },
         Blit = new GLCmdBlitRecording
         {
             Grid = buffer.Record.BlitGrid,
         },
     });
 }