5 namespace SiliconStudio.
Paradox.Effects
7 internal static class MeshRenderExtensions
9 internal static ModelRendererState GetModelRendererState(
this RenderPass pass)
11 return GetOrCreateModelRendererState(pass,
false);
14 internal static ModelRendererState GetOrCreateModelRendererState(
this RenderPass pass,
bool createMeshStateIfNotFound =
true)
16 var pipeline = pass.Pipeline;
19 throw new ArgumentException(
"RenderPass is not associated with a RenderPipeline",
"pass");
21 var pipelineState = pipeline.Tags.Get(ModelRendererState.Key);
22 if (createMeshStateIfNotFound && pipelineState == null)
24 pipelineState =
new ModelRendererState();
25 pipeline.Tags.Set(ModelRendererState.Key, pipelineState);