Axiom.Graphics.GpuProgramParameters.GpuNamedConstants.GenerateConstantDefinitionArrayEntries C# (CSharp) Method

GenerateConstantDefinitionArrayEntries() private method

private GenerateConstantDefinitionArrayEntries ( String paramName, GpuConstantDefinition baseDef ) : void
paramName String
baseDef GpuConstantDefinition
return void
			public void GenerateConstantDefinitionArrayEntries( String paramName, GpuConstantDefinition baseDef )
			{
				// Copy definition for use with arrays
				var arrayDef = baseDef;
				arrayDef.ArraySize = 1;

			    // Add parameters for array accessors
				// [0] will refer to the same location, [1+] will increment
				// only populate others individually up to 16 array slots so as not to get out of hand,
				// unless the system has been explicitly configured to allow all the parameters to be added

				// paramName[0] version will always exist
				var maxArrayIndex = 1;
				if ( baseDef.ArraySize <= 16 || GenerateAllConstantDefinitionArrayEntries )
				{
					maxArrayIndex = baseDef.ArraySize;
				}

				for ( var i = 0; i < maxArrayIndex; i++ )
				{
					var arrayName = paramName + "[" + i + "]";
                    Map.Add(arrayName, arrayDef);
					// increment location
					arrayDef.PhysicalIndex += arrayDef.ElementSize;					
				}
				// note no increment of buffer sizes since this is shared with main array def
			}
GpuProgramParameters.GpuNamedConstants