private SetLogicalIndexes ( GpuLogicalBufferStruct floatIndexMap, GpuLogicalBufferStruct intIndexMap ) : void | ||
floatIndexMap | GpuLogicalBufferStruct | |
intIndexMap | GpuLogicalBufferStruct | |
return | void |
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() );
}
}
protected virtual void PopulateParameterNames(GpuProgramParameters parms) { var defs = ConstantDefinitions; // Axiom: Ogre has SIDE EFFECT here!! parms.NamedConstants = constantDefs; // also set logical / physical maps for programs which use this parms.SetLogicalIndexes(floatLogicalToPhysical, intLogicalToPhysical); }