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


C# GpuProgramParameters.CopySharedParams方法代码示例

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


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

示例1: BindGpuProgramParameters

		public override void BindGpuProgramParameters( GpuProgramType type, GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability mask )
		{
			if ( ( mask & GpuProgramParameters.GpuParamVariability.Global ) == GpuProgramParameters.GpuParamVariability.Global )
			{
				//Just copy
				parms.CopySharedParams();
			}

			switch ( type )
			{
				case GpuProgramType.Vertex:
					activeVertexGpuProgramParameters = parms;
					this.currentVertexProgram.BindProgramParameters( parms, (uint) mask );
					break;
				case GpuProgramType.Fragment:
					activeFragmentGpuProgramParameters = parms;
					this.currentFragmentProgram.BindProgramParameters( parms, (uint) mask );
					break;
				case GpuProgramType.Geometry:
				default:
					break;
			}
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:23,代码来源:GLES2RenderSystem.cs

示例2: BindGpuProgramParameters

        public override void BindGpuProgramParameters(GpuProgramType gptype, GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability variability)
        {
            // special case pass iteration
            if (variability == GpuProgramParameters.GpuParamVariability.PassIterationNumber)
            {
                BindGpuProgramPassIterationParameters(gptype);
                return;
            }

            if ((variability & GpuProgramParameters.GpuParamVariability.Global) != 0)
            {
                // D3D9 doesn't support shared constant buffers, so use copy routine
                parms.CopySharedParams();
            }

            switch ( gptype )
            {
                case GpuProgramType.Vertex:
                    activeVertexGpuProgramParameters = parms;

                    if ( parms.HasFloatConstants )
                    {
                        for ( var index = 0; index < parms.FloatConstantCount; index++ )
                        {
                            var entry = parms.GetFloatConstant( index );

                            if ( entry.isSet )
                            {
                                ActiveD3D9Device.SetVertexShaderConstant(index, entry.val, 0, 1);
                            }
                        }
                    }
                    if (parms.HasIntConstants)
                    {
                        for (var index = 0; index < parms.IntConstantCount; index++)
                        {
                            var entry = parms.GetIntConstant(index);

                            if (entry.isSet)
                            {
                                ActiveD3D9Device.SetVertexShaderConstant(index, entry.val, 0, 1);
                            }
                        }
                    }

                    break;

                case GpuProgramType.Fragment:
                    activeFragmentGpuProgramParameters = parms;

                    if (parms.HasFloatConstants)
                    {
                        for (var index = 0; index < parms.FloatConstantCount; index++)
                        {
                            var entry = parms.GetFloatConstant(index);

                            if (entry.isSet)
                            {
                                ActiveD3D9Device.SetPixelShaderConstant(index, entry.val, 0, 1);
                            }
                        }
                    }
                    if ( parms.HasIntConstants )
                    {
                        for ( var index = 0; index < parms.IntConstantCount; index++ )
                        {
                            var entry = parms.GetIntConstant( index );

                            if ( entry.isSet )
                            {
                                ActiveD3D9Device.SetPixelShaderConstant(index, entry.val, 0, 1);
                            }
                        }
                    }

                    
                    break;
            }
        }
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:79,代码来源:D3DRenderSystem.cs

示例3: BindGpuProgramParameters

		public override void BindGpuProgramParameters( GpuProgramType type, GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability mask )
		{
            if ((mask & GpuProgramParameters.GpuParamVariability.Global) != 0)
            {
                // We could maybe use GL_EXT_bindable_uniform here to produce Dx10-style
                // shared constant buffers, but GPU support seems fairly weak?
                // for now, just copy
                parms.CopySharedParams();
            }

			// store the current program in use for eas unbinding later);
			switch (type)
			{
                case GpuProgramType.Vertex:
                    activeVertexGpuProgramParameters = parms;
				    currentVertexProgram.BindProgramParameters( parms, mask );
			        break;
                case GpuProgramType.Geometry:
                    activeGeometryGpuProgramParameters = parms;
                    currentGeometryProgram.BindProgramParameters(parms, mask);
                    break;
                case GpuProgramType.Fragment:
                    activeFragmentGpuProgramParameters = parms;
                    currentFragmentProgram.BindProgramParameters(parms, mask);
                    break;

			}
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:28,代码来源:GLRenderSystem.cs


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