Skip to content

Commit

Permalink
renamed GpuNamedConstants.cs
Browse files Browse the repository at this point in the history
more 2790 updates
  • Loading branch information
WolfgangSt committed Jun 15, 2011
1 parent 6eda125 commit af77c2a
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 72 deletions.
4 changes: 2 additions & 2 deletions Projects/Axiom/Engine/Axiom.2010.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@
<Compile Include="EventHandler.cs" />
<Compile Include="Graphics\GpuProgramParameters.GpuConstantDefinition.cs" />
<Compile Include="Graphics\GpuProgramParameters.AutoConstants.cs" />
<Compile Include="Graphics\GpuProgramParameters.ConstantEntry.cs" />
<Compile Include="Graphics\GpuProgramParameters.AutoConstantEntry.cs" />
<Compile Include="Graphics\GpuProgramParameters.GpuConstantDefinitionMap.cs" />
<Compile Include="Graphics\GpuProgramParameters.GpuNamedConstant.cs" />
<Compile Include="Graphics\GpuProgramParameters.GpuNamedConstants.cs" />
<Compile Include="Graphics\GpuProgramParameters.GpuLogicalBufferStruct.cs" />
<Compile Include="Graphics\GpuProgramParameters.GpuSharedParametersUsage.cs" />
<Compile Include="Graphics\GpuProgramParameters.Lists.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,89 @@ partial class GpuProgramParameters
/// A structure for recording the use of automatic parameters.
/// </summary>
public class AutoConstantEntry
{
/// <summary>
{
#region Type
/// <summary>
/// The type of the parameter.
/// </summary>
[OgreVersion(1, 7, 2790)]
public AutoConstantType Type;
/// <summary>

#endregion

#region PhysicalIndex

/// <summary>
/// The target index.
/// </summary>
[OgreVersion(1, 7, 2790)]
public int PhysicalIndex;
/// <summary>

#endregion

#region ElementCount

/// <summary>
/// The number of elements per individual entry in this constant
/// Used in case people used packed elements smaller than 4 (e.g. GLSL)
/// and bind an auto which is 4-element packed to it
/// </summary>
[OgreVersion(1, 7, 2790)]
public int ElementCount;

#endregion

#region Data

/// <summary>
/// Any additional info to go with the parameter.
/// </summary>
[OgreVersion(1, 7, 2790)]
public int Data;
/// <summary>

#endregion

#region FData

/// <summary>
/// Any additional info to go with the parameter.
/// </summary>
[OgreVersion(1, 7, 2790)]
public float FData;

/// <summary>
#endregion

#region Variability

/// <summary>
/// The Variability of this parameter (see <see>GpuParamVariability</see>)
/// </summary>
[OgreVersion(1, 7, 2790)]
public GpuParamVariability Variability;

/// <summary>
/// Default constructor.
/// </summary>
/// <param name="type">Type of auto param (i.e. WorldViewMatrix, etc)</param>
/// <param name="index">Index of the param.</param>
/// <param name="data">Any additional info to go with the parameter.</param>
/// <param name="variability">Variability of parameter</param>
public AutoConstantEntry( AutoConstantType type, int index, int data, GpuParamVariability variability )
#endregion

#region constructor

/// <summary>
/// Default constructor.
/// </summary>
/// <param name="type">Type of auto param (i.e. WorldViewMatrix, etc)</param>
/// <param name="index">Index of the param.</param>
/// <param name="data">Any additional info to go with the parameter.</param>
/// <param name="variability">Variability of parameter</param>
/// <param name="elementCount"></param>
[OgreVersion(1, 7, 2790)]
public AutoConstantEntry( AutoConstantType type, int index, int data,
GpuParamVariability variability, int elementCount = 4 )
{
this.Type = type;
this.PhysicalIndex = index;
this.Data = data;
this.Variability = variability;
Type = type;
PhysicalIndex = index;
Data = data;
Variability = variability;
ElementCount = elementCount;

// this is likeley obsolete in as ogre doesnt have this (anymore?)
System.Diagnostics.Debug.Assert( type != AutoConstantType.SinTime_0_X );
}

Expand All @@ -96,25 +143,34 @@ public AutoConstantEntry( AutoConstantType type, int index, int data, GpuParamVa
/// <param name="index">Index of the param.</param>
/// <param name="fdata">Any additional info to go with the parameter.</param>
/// <param name="variability">Variability of parameter</param>
public AutoConstantEntry( AutoConstantType type, int index, float fdata, GpuParamVariability variability )
/// <param name="elementCount"></param>
[OgreVersion(1, 7, 2790)]
public AutoConstantEntry( AutoConstantType type, int index, float fdata,
GpuParamVariability variability, int elementCount = 4 )
{
this.Type = type;
this.PhysicalIndex = index;
this.FData = fdata;
this.Variability = variability;

Type = type;
PhysicalIndex = index;
FData = fdata;
Variability = variability;
ElementCount = elementCount;
}

public AutoConstantEntry Clone()
{
AutoConstantEntry rv = new AutoConstantEntry( this.Type, this.PhysicalIndex, this.FData, this.Variability );
rv.Data = this.Data;
return rv;
}
}
#endregion

/// <summary>
/// </summary>
#region Clone

[AxiomHelper(0, 8)]
public AutoConstantEntry Clone()
{
var n = new AutoConstantEntry(Type, PhysicalIndex, FData, Variability, ElementCount);
n.Data = Data;
return n;
}

#endregion
}

[OgreVersion(1, 7, 2790)]
public class AutoConstantsList : List<AutoConstantEntry>
{
public AutoConstantsList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public T this[int index]
}


#region unsupported operations
#region unimplemented operations

public bool Contains(T item)
{
Expand Down
95 changes: 59 additions & 36 deletions Projects/Axiom/Engine/Graphics/GpuProgramParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,41 +186,14 @@ public struct ParameterEntry

#endregion

/// <summary>
/// List of automatically updated parameters.
/// </summary>
protected AutoConstantsList autoConstantList = new AutoConstantsList();
/// <summary>
/// Lookup of constant indicies for named parameters.
/// </summary>
protected AxiomCollection<int> namedParams = new AxiomCollection<int>();
/// <summary>
/// Specifies whether matrices need to be transposed prior to
/// being sent to the hardware.
/// </summary>
protected bool transposeMatrices;
/// <summary>
/// Temp array for use when passing constants around.
/// </summary>
protected float[] tmpVals = new float[ 4 ];
/// <summary>
/// Flag to indicate if names not found will be automatically added.
/// </summary>
protected bool autoAddParamName = true;

protected List<ParameterEntry> paramTypeList = new List<ParameterEntry>();
//protected ArrayList paramIndexTypes = new ArrayList();

protected bool ignoreMissingParameters = false;

#region floatLogicalToPhysical

/// <summary>
/// Logical index to physical index map - for low-level programs
/// or high-level programs which pass params this way.
/// </summary>
[OgreVersion(1, 7, 2790)]
protected GpuLogicalBufferStruct floatLogicalToPhysical;
protected GpuLogicalBufferStruct floatLogicalToPhysical;

[OgreVersion(1, 7, 2790)]
public GpuLogicalBufferStruct FloatLogicalBufferStruct
Expand All @@ -231,7 +204,7 @@ public GpuLogicalBufferStruct FloatLogicalBufferStruct
}
}

#endregion
#endregion

#region intLogicalToPhysical

Expand All @@ -252,21 +225,71 @@ public GpuLogicalBufferStruct IntLogicalBufferStruct

#endregion

[OgreVersion(1, 7, 2790)]
private GpuNamedConstants _namedConstants;

/// <summary>
/// Mapping from parameter names to def - high-level programs are expected to populate this
/// </summary>
public GpuNamedConstants NamedConstants
{
set
{
}
}

#region _combinedVariability

/// <summary>
/// The combined variability masks of all parameters
/// </summary>
[OgreVersion(1, 7, 2790)]
private GpuParamVariability _combinedVariability;

#endregion

/// <summary>
/// List of automatically updated parameters.
/// </summary>
protected AutoConstantsList autoConstantList = new AutoConstantsList();
/// <summary>
/// Lookup of constant indicies for named parameters.
/// </summary>
protected AxiomCollection<int> namedParams = new AxiomCollection<int>();
/// <summary>
/// Specifies whether matrices need to be transposed prior to
/// being sent to the hardware.
/// </summary>
protected bool transposeMatrices;
/// <summary>
/// Temp array for use when passing constants around.
/// </summary>
protected float[] tmpVals = new float[ 4 ];
/// <summary>
/// Flag to indicate if names not found will be automatically added.
/// </summary>
protected bool autoAddParamName = true;

protected List<ParameterEntry> paramTypeList = new List<ParameterEntry>();
//protected ArrayList paramIndexTypes = new ArrayList();

protected bool ignoreMissingParameters = false;



#endregion Fields

#region Constructors

private int _myID;
private static int _idCounter;

/// <summary>
/// Default constructor.
/// </summary>
public GpuProgramParameters()
{
this.autoAddParamName = true;
var _myID = _idCounter++;
Debug.WriteLine( string.Format("GpuProgramParameters() = {0}", _myID) );
{
_combinedVariability = GpuParamVariability.Global;
transposeMatrices = false;
ignoreMissingParameters = false;
activePassIterationIndex = int.MaxValue;
}

#endregion Constructors
Expand Down

0 comments on commit af77c2a

Please sign in to comment.