当前位置: 首页>>代码示例>>C#>>正文


C# DX11RenderContext.CleanShaderStages方法代码示例

本文整理汇总了C#中FeralTic.DX11.DX11RenderContext.CleanShaderStages方法的典型用法代码示例。如果您正苦于以下问题:C# DX11RenderContext.CleanShaderStages方法的具体用法?C# DX11RenderContext.CleanShaderStages怎么用?C# DX11RenderContext.CleanShaderStages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FeralTic.DX11.DX11RenderContext的用法示例。


在下文中一共展示了DX11RenderContext.CleanShaderStages方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Render

 public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
 {
     if (this.FEnabled[0])
     {
         context.CleanShaderStages();
     }
     if (this.FLayerIn.IsConnected)
     {
         for (int i = 0; i < this.FLayerIn.SliceCount; i++)
         {
             this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings);
         }
     }
 }
开发者ID:dotprodukt,项目名称:dx11-vvvv,代码行数:14,代码来源:DX11LayerClearPipelineNode.cs

示例2: Render

        public void Render(DX11RenderContext context)
        {
            if (this.lasthandle != this.Handle)
             {
                 if (this.swapchain != null)
                 {
                     if (this.swapchain.Contains(context)) { this.swapchain.Dispose(context); }
                 }
                 this.lasthandle = this.Handle;
             }

             if (!this.swapchain.Contains(context))
             {
                 this.swapchain[context] = new DX11SwapChain(context, this.Handle, SlimDX.DXGI.Format.R8G8B8A8_UNorm, new SampleDescription(1, 0));
             }

             if (this.resized)
             {
                 this.swapchain[context].Resize();
             }

             if (this.FEnabled[0])
             {
                 context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV,new SlimDX.Color4(0,0,0,0));
             }

             if (this.FIn.PluginIO.IsConnected && this.FEnabled[0])
             {
                 int id = this.FIndex[0];
                 if (this.FIn[id].Contains(context))
                 {
                     context.RenderTargetStack.Push(this.swapchain[context]);
                     var rs = new DX11RenderState();

                     if (FAlpha[0])
                     {
                     	rs.Blend = DX11BlendStates.Instance.GetState("Blend");
                     	context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV, FInBgColor[0].Color);
                     }
                     context.RenderStateStack.Push(rs);
                     context.CleanShaderStages();

                     context.Primitives.FullTriVS.GetVariableBySemantic("TEXTURE").AsResource().SetResource(this.FIn[id][context].SRV);
                     context.Primitives.FullScreenTriangle.Bind(null);
                     context.Primitives.ApplyFullTri();
                     context.Primitives.FullScreenTriangle.Draw();

                     context.RenderStateStack.Pop();
                     context.RenderTargetStack.Pop();
                     context.CleanUpPS();
                 }
             }
        }
开发者ID:nissidis,项目名称:dx11-vvvv,代码行数:53,代码来源:DX11PreviewNode.cs

示例3: Render

        public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings)
        {
            if (this.spmax > 0)
            {
                if (this.FEnabled[0])
                {
                    context.CleanShaderStages();
                    QuadShaderDeviceData qd = quaddata[context];
                    qd.quadshader.SetBySemantic("VIEWPROJECTION", settings.ViewProjection);

                    if (this.BeginQuery != null)
                    {
                        this.BeginQuery(context);
                    }

                    bool multisampler = this.FInSamplerState.SliceCount > 1 && this.FInTexture.IsConnected;

                    if (this.FInState.SliceCount > 1 || this.FInTexture.SliceCount > 1 || multisampler)
                    {
                        if (this.FInTexture.IsConnected)
                        {
                            this.RenderTextured(context);
                        }
                        else
                        {
                            this.RenderBasic(context);
                        }
                    }
                    else
                    {
                        if (this.FInTexture.IsConnected)
                        {
                            this.RenderInstancedTextured(context);
                        }
                        else
                        {
                            this.RenderInstanced(context);
                        }
                    }

                    if (this.EndQuery != null)
                    {
                        this.EndQuery(context);
                    }
                }
            }
        }
开发者ID:dotprodukt,项目名称:dx11-vvvv,代码行数:47,代码来源:QuadNode.cs

示例4: Render

        public void Render(DX11RenderContext context)
        {
            if (this.lasthandle != this.Handle)
             {
                 if (this.swapchain != null)
                 {
                     if (this.swapchain.Contains(context)) { this.swapchain.Dispose(context); }
                 }
                 this.lasthandle = this.Handle;
             }

             if (!this.swapchain.Contains(context))
             {
                 this.swapchain[context] = new DX11SwapChain(context, this.Handle,
                     SlimDX.DXGI.Format.R8G8B8A8_UNorm, new SampleDescription(1, 0),60,1);
             }

             if (this.resized)
             {
                 this.swapchain[context].Resize();
             }

             if (this.FEnabled[0])
             {
                 context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV,new SlimDX.Color4(0,0,0,0));
             }

             if (this.FIn.IsConnected && this.spreadMax > 0 && this.FEnabled[0])
             {
                 int id = this.FIndex[0];
                 if (this.FIn[id].Contains(context) && this.FIn[id][context] != null)
                 {
                     context.RenderTargetStack.Push(this.swapchain[context]);
                     var rs = new DX11RenderState();

                     if (FAlpha[0])
                     {
                     	rs.Blend = DX11BlendStates.Instance.GetState("Blend");
                     	context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV, FInBgColor[0].Color);
                     }
                     context.RenderStateStack.Push(rs);
                     context.CleanShaderStages();

                     context.Primitives.FullTriVS.GetVariableBySemantic("TEXTURE").AsResource().SetResource(this.FIn[id][context].SRV);

                     EffectSamplerVariable samplervariable = context.Primitives.FullTriVS.GetVariableByName("linSamp").AsSampler();
                     SamplerState state = null;
                     if (this.FInSamplerState.IsConnected)
                     {

                         state = SamplerState.FromDescription(context.Device, this.FInSamplerState[0]);
                         samplervariable.SetSamplerState(0, state);
                     }
                     else
                     {
                         samplervariable.UndoSetSamplerState(0);
                     }

                     context.Primitives.FullScreenTriangle.Bind(null);
                     context.Primitives.ApplyFullTri();
                     context.Primitives.FullScreenTriangle.Draw();

                     context.RenderStateStack.Pop();
                     context.RenderTargetStack.Pop();
                     context.CleanUpPS();
                     samplervariable.UndoSetSamplerState(0); //undo as can be used in other places

                     if (state != null)
                     {
                         state.Dispose();
                     }
                 }
             }
        }
开发者ID:sebllll,项目名称:dx11-vvvv,代码行数:74,代码来源:DX11PreviewNode.cs


注:本文中的FeralTic.DX11.DX11RenderContext.CleanShaderStages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。