/// <summary> /// Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.InputElement" /> struct. /// </summary> /// <param name = "name">The HLSL semantic associated with this element in a shader input-signature.</param> /// <param name = "index">The semantic index for the element. A semantic index modifies a semantic, with an integer index number. A semantic index is only needed in a case where there is more than one element with the same semantic. For example, a 4x4 matrix would have four components each with the semantic name matrix, however each of the four component would have different semantic indices (0, 1, 2, and 3).</param> /// <param name = "format">The data type of the element data.</param> /// <param name = "offset">Offset (in bytes) between each element. Use AppendAligned for convenience to define the current element directly after the previous one, including any packing if necessary.</param> /// <param name = "slot">An integer value that identifies the input-assembler. Valid values are between 0 and 15.</param> /// <param name = "slotClass">Identifies the input data class for a single input slot.</param> /// <param name = "stepRate">The number of instances to draw using the same per-instance data before advancing in the buffer by one element. This value must be 0 for an element that contains per-vertex data.</param> public InputElement(string name, int index, Format format, int offset, int slot, InputClassification slotClass, int stepRate) { this.SemanticName = name; this.SemanticIndex = index; this.Format = format; this.Slot = slot; this.AlignedByteOffset = offset; this.Classification = slotClass; this.InstanceDataStepRate = stepRate; }
public InputElement(string semanticName, int semanticIndex, Format format, int inputSlot, int alignedByteOffset, InputClassification inputSlotClass, int instanceDataStepRate) { SemanticName = semanticName; SemanticIndex = semanticIndex; Format = format; InputSlot = inputSlot; AlignedByteOffset = alignedByteOffset; InputSlotClass = inputSlotClass; InstanceDataStepRate = instanceDataStepRate; }
protected override int GetNextIndex(InputClassification inputDataClass, int index) { if (_stepRate == 0 || inputDataClass == InputClassification.PerVertexData) return index; if (++_steps == _stepRate) { _steps = 0; _index++; } return _index; }
/// <summary> /// Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.InputElement" /> struct. /// </summary> /// <param name = "name">The HLSL semantic associated with this element in a shader input-signature.</param> /// <param name = "index">The semantic index for the element. A semantic index modifies a semantic, with an integer index number. A semantic index is only needed in a case where there is more than one element with the same semantic. For example, a 4x4 matrix would have four components each with the semantic name matrix, however each of the four component would have different semantic indices (0, 1, 2, and 3).</param> /// <param name = "format">The data type of the element data.</param> /// <param name = "offset">Offset (in bytes) between each element. Use AppendAligned for convenience to define the current element directly after the previous one, including any packing if necessary.</param> /// <param name = "slot">An integer value that identifies the input-assembler. Valid values are between 0 and 15.</param> /// <param name = "slotClass">Identifies the input data class for a single input slot.</param> /// <param name = "stepRate">The number of instances to draw using the same per-instance data before advancing in the buffer by one element. This value must be 0 for an element that contains per-vertex data.</param> public InputElement(string name, int index, Format format, int offset, int slot, InputClassification slotClass, int stepRate) { this.SemanticName = name; this.SemanticIndex = index; this.Format = format; this.Slot = slot; this.AlignedByteOffset = offset; this.Classification = slotClass; this.InstanceDataStepRate = stepRate; }
/// <summary> /// Initializes a new instance of the <see cref="InputElementDescription"/> struct. /// </summary> /// <param name="semanticName">The HLSL semantic associated with this element in a shader input-signature.</param> /// <param name="semanticIndex">The semantic index for the element. A semantic index modifies a semantic, with an integer index number. A semantic index is only needed in a case where there is more than one element with the same semantic.</param> /// <param name="format">The <see cref="Vortice.DirectX.DXGI.Format"/> value that specifies the format of the element data.</param> /// <param name="offset">Offset, in bytes, between each element. Use <see cref="AppendAligned"/> (0xffffffff) for convenience to define the current element directly after the previous one, including any packing if necessary.</param> /// <param name="slot">The input-assembler slot.</param> /// <param name="slotClass">A <see cref="InputClassification"/> value that identifies the input data class for a single input slot.</param> /// <param name="stepRate">The number of instances to draw using the same per-instance data before advancing in the buffer by one element. This value must be 0 for an element that contains per-vertex data (the slot class is set to the <see cref="InputClassification.PerVertexData"/> member of <see cref="InputClassification"/>).</param> public InputElementDescription(string semanticName, int semanticIndex, Format format, int offset, int slot, InputClassification slotClass, int stepRate) { SemanticName = semanticName; SemanticIndex = semanticIndex; Format = format; Slot = slot; AlignedByteOffset = offset; Classification = slotClass; InstanceDataStepRate = stepRate; }
public D3D11_INPUT_ELEMENT_DESC_EX(string name, int index, Format format, int offset, int slot, InputClassification slotClass, int stepRate) { element = new InputElement(name, index, format, offset, slot, slotClass, stepRate); SemanticType = 0; SemanticNo = 0; }
public VertexLayoutDescription(InputClassification classification, int stride) { Classification = classification; Stride = stride; }
protected virtual int GetNextIndex(InputClassification inputDataClass, int index) { return(index + 1); }
public void Increment(InputClassification inputDataClass) { _index = GetNextIndex(inputDataClass, _index); }
protected virtual int GetNextIndex(InputClassification inputDataClass, int index) { return index + 1; }
public void Increment(InputClassification inputDataClass) { _index = GetNextIndex(inputDataClass, _index); }