/// <summary> /// /// </summary> /// <param name="passDescription"></param> /// <param name="manager"></param> public ShaderPass(ShaderPassDescription passDescription, IEffectsManager manager) { Name = passDescription.Name; effectsManager = manager; if (passDescription.ShaderList != null) { foreach (var shader in passDescription.ShaderList) { var s = manager.ShaderManager.RegisterShader(shader); switch (shader.ShaderType) { case ShaderStage.Vertex: vertexShader = s as VertexShader; break; case ShaderStage.Domain: domainShader = s as DomainShader; break; case ShaderStage.Hull: hullShader = s as HullShader; break; case ShaderStage.Geometry: geometryShader = s as GeometryShader; break; case ShaderStage.Pixel: pixelShader = s as PixelShader; break; case ShaderStage.Compute: computeShader = s as ComputeShader; break; } } } blendState = passDescription.BlendStateDescription != null? manager.StateManager.Register((BlendStateDescription)passDescription.BlendStateDescription) : BlendStateProxy.Empty; depthStencilState = passDescription.DepthStencilStateDescription != null? manager.StateManager.Register((DepthStencilStateDescription)passDescription.DepthStencilStateDescription) : DepthStencilStateProxy.Empty; rasterState = passDescription.RasterStateDescription != null? manager.StateManager.Register((RasterizerStateDescription)passDescription.RasterStateDescription) : RasterizerStateProxy.Empty; BlendFactor = passDescription.BlendFactor; StencilRef = passDescription.StencilRef; SampleMask = passDescription.SampleMask; Topology = passDescription.Topology; if (passDescription.InputLayoutDescription != null) { layout = manager.ShaderManager.RegisterInputLayout(passDescription.InputLayoutDescription); } }
public void Reset() { CurrShaderPass = null; currRasterState = null; currBlendState = null; currDepthStencilState = null; currBlendFactor = null; currSampleMask = uint.MaxValue; currStencilRef = 0; }
public void SetDepthStencilState(DepthStencilStateProxy depthStencilState, int stencilRef = 0) { if (AutoSkipRedundantStateSetting && currDepthStencilState == depthStencilState && currStencilRef == stencilRef) { return; } deviceContext.OutputMerger.SetDepthStencilState(depthStencilState, stencilRef); currDepthStencilState = depthStencilState; currStencilRef = stencilRef; }
public void Reset() { CurrShaderPass = null; currRasterState = null; currBlendState = null; currDepthStencilState = null; currBlendFactor = null; currSampleMask = uint.MaxValue; currStencilRef = 0; currInputLayout = null; currPrimitiveTopology = PrimitiveTopology.Undefined; }
/// <summary> /// Sets the state. /// </summary> /// <param name="depthStencilStateDesc">The depth stencil state desc.</param> public void SetState(DepthStencilStateDescription?depthStencilStateDesc) { if (IsNULL) { return; } if (DepthStencilState != DepthStencilStateProxy.Empty) { RemoveAndDispose(ref depthStencilState); } depthStencilState = depthStencilStateDesc != null? effectsManager.StateManager.Register(depthStencilStateDesc.Value) : DepthStencilStateProxy.Empty; }
public void Reset() { currRasterState = null; currBlendState = null; currDepthStencilState = null; currBlendFactor = null; currSampleMask = uint.MaxValue; currStencilRef = 0; currInputLayout = null; currPrimitiveTopology = PrimitiveTopology.Undefined; for (int i = 0; i < ConstantBufferCheck.Length; ++i) { ConstantBufferCheck[i] = null; } for (int i = 0; i < SamplerStateCheck.Length; ++i) { SamplerStateCheck[i] = null; } }
/// <summary> /// Sets the state of the depth stencil. /// </summary> /// <param name="depthStencilState">State of the depth stencil.</param> /// <param name="stencilRef">The stencil reference.</param> public void SetDepthStencilState(DepthStencilStateProxy depthStencilState, int stencilRef) { DeviceContext.OutputMerger.SetDepthStencilState(depthStencilState, stencilRef); }
/// <summary> /// Sets the state of the depth stencil. /// </summary> /// <param name="depthStencilState">State of the depth stencil.</param> public void SetDepthStencilState(DepthStencilStateProxy depthStencilState) { DeviceContext.OutputMerger.SetDepthStencilState(depthStencilState); }