コード例 #1
0
 List <StageElement> GetElementsForStage(Rendering.ShaderType stageType)
 {
     if (stageType == Rendering.ShaderType.Vertex)
     {
         return(vertexStageElements);
     }
     else if (stageType == Rendering.ShaderType.Fragment)
     {
         return(fragmentStageElements);
     }
     return(null);
 }
コード例 #2
0
            public void AppendBlockInstance(BlockInstance blockInstance, Rendering.ShaderType stageType)
            {
                List <StageElement> stageElements = GetElementsForStage(stageType);

                if (stageElements == null)
                {
                    throw new Exception($"Stage {stageType} is not valid.");
                }

                stageElements.Add(new StageElement {
                    BlockInstance = blockInstance
                });
            }
コード例 #3
0
            public void AppendCustomizationPoint(CustomizationPoint customizationPoint, Rendering.ShaderType stageType)
            {
                List <StageElement> stageElements = GetElementsForStage(stageType);

                if (stageElements == null)
                {
                    throw new Exception($"Stage {stageType} is not valid.");
                }

                // Make sure the customization point hasn't been added multiple times.
                var element = stageElements.Find((e) => (e.CustomizationPoint == customizationPoint));

                if (element != null)
                {
                    throw new Exception($"Customization point {customizationPoint.Name} cannot be added to a stage multiple times.");
                }

                stageElements.Add(new StageElement {
                    CustomizationPoint = customizationPoint
                });
            }