static byte GenerateClearValues(GLCmdRenderPassCommand pass, List <GLCmdClearValuesParameter> clearValues) { var glPass = pass.Origin as IGLRenderPass; if (glPass == null) { throw new InvalidCastException(); } var finalLength = Math.Min(glPass.AttachmentFormats.Length, pass.ClearValues.Length); var finalValues = new List <GLClearValueArrayItem> (); for (var i = 0; i < finalLength; ++i) { finalValues.Add(new GLClearValueArrayItem { Attachment = glPass.AttachmentFormats [i], Value = pass.ClearValues [i] }); } var nextIndex = clearValues.Count; clearValues.Add(new GLCmdClearValuesParameter { Attachments = finalValues.ToArray(), }); return((byte)nextIndex); }
void InsertNewPipeline( GLCmdRenderPassCommand pass, IGLGraphicsPipeline pipeline, List <GLCmdBufferPipelineItem> pipelines, List <GLCmdClearValuesParameter> clearValues, List <GLGraphicsPipelineBlendColorState> colorBlends ) { var pipelineItem = GeneratePipelineItem(pipeline); pipelineItem.DepthState = pipeline.DepthState; pipelineItem.StencilState = pipeline.StencilState; pipelineItem.ClearValues = GenerateClearValues(pass, clearValues); pipelineItem.ColorBlendEnums = GenerateBlendEnums(pipeline, colorBlends); pipelines.Add(pipelineItem); }