public GpuLogicalBufferStruct Clone()
 {
     var p = new GpuLogicalBufferStruct();
     p.BufferSize = BufferSize;
     foreach (var i in Map)
         p.Map.Add(i.Key, i.Value.Clone());
     return p;
 }
Exemple #2
0
            public GpuLogicalBufferStruct Clone()
            {
                var p = new GpuLogicalBufferStruct();

                p.BufferSize = this.BufferSize;
                foreach (var i in this.Map)
                {
                    p.Map.Add(i.Key, i.Value.Clone());
                }
                return(p);
            }
        public void SetLogicalIndexes(GpuLogicalBufferStruct floatIndexMap, GpuLogicalBufferStruct intIndexMap)
	    {
            floatLogicalToPhysical = floatIndexMap;
            intLogicalToPhysical = intIndexMap;

            // resize the internal buffers
            // Note that these will only contain something after the first parameter
            // set has set some parameters

            // Size and reset buffer (fill with zero to make comparison later ok)
            if (floatIndexMap != null && floatIndexMap.BufferSize > floatConstants.Count)
            {
                while (floatConstants.Count < floatIndexMap.BufferSize)
                    floatConstants.Add( new FloatConstantEntry() );
            }
            if (intIndexMap != null && intIndexMap.BufferSize > intConstants.Count)
            {
                while (intConstants.Count < intIndexMap.BufferSize)
                    intConstants.Add( new IntConstantEntry() );
            }
	    }
		public void SetLogicalIndexes( GpuLogicalBufferStruct floatIndexMap, GpuLogicalBufferStruct intIndexMap )
		{
			this.floatLogicalToPhysical = floatIndexMap;
			this.intLogicalToPhysical = intIndexMap;

			// resize the internal buffers
			// Note that these will only contain something after the first parameter
			// set has set some parameters

			// Size and reset buffer (fill with zero to make comparison later ok)
			if ( floatIndexMap != null && floatIndexMap.BufferSize > this.floatConstants.Count )
			{
				this.floatConstants.AddRange( Enumerable.Repeat( 0.0f, floatIndexMap.BufferSize - this.floatConstants.Count ) );
			}
			if ( intIndexMap != null && intIndexMap.BufferSize > this.intConstants.Count )
			{
				this.intConstants.AddRange( Enumerable.Repeat( 0, intIndexMap.BufferSize - this.intConstants.Count ) );
			}
		}
		public GpuProgramParameters( GpuProgramParameters other )
			: base()
		{
			// let compiler perform shallow copies of structures 
			// AutoConstantEntry, RealConstantEntry, IntConstantEntry
			this.floatConstants = new FloatConstantList( other.floatConstants ); // vector<float> in ogre => shallow copy
			this.intConstants = new IntConstantList( other.intConstants ); // vector<int> in ogre => shallow copy

			this.autoConstants = new AutoConstantsList(); // vector<AutoConstantEntry> in ogre => deep copy
			foreach ( var ac in other.autoConstants )
			{
				this.autoConstants.Add( ac.Clone() );
			}

			// copy value members
			this.floatLogicalToPhysical = other.floatLogicalToPhysical; // pointer in ogre => no Clone
			this.intLogicalToPhysical = other.intLogicalToPhysical; // pointer in ogre => no Clone
			this._namedConstants = other._namedConstants; // pointer in ogre => no Clone
			CopySharedParamSetUsage( other._sharedParamSets );

			this._combinedVariability = other._combinedVariability;
			TransposeMatrices = other.TransposeMatrices;
			this.ignoreMissingParameters = other.ignoreMissingParameters;
			this.activePassIterationIndex = other.activePassIterationIndex;
		}
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GpuLogicalBufferStruct obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }