Struct GorgonStreamOutElement
A stream out element for a stream out buffer.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public readonly struct GorgonStreamOutElement : IGorgonNamedObject, IGorgonEquatableByRef<GorgonStreamOutElement>, IEquatable<GorgonStreamOutElement>
Remarks
This defines a single element within a GorgonStreamOutLayout, and its relationship with other elements in that layout.
A GorgonStreamOutLayout will use an array of these items to define individual elements for a stream out slot.
Constructors
| Edit this page View SourceGorgonStreamOutElement(string, byte, byte, byte, int, int)
Initializes a new instance of the GorgonStreamOutElement class.
Declaration
public GorgonStreamOutElement(string context, byte start, byte count, byte slot, int index = 0, int stream = 0)
Parameters
Type | Name | Description |
---|---|---|
string | context | The context for the element. This is used to indicate the HLSL semantic for the element. |
byte | start | The component to start writing out to. |
byte | count | The number of components to write out. |
byte | slot | The associated stream output buffer that is bound to the pipeline. |
int | index | [Optional] The index of the element. This is used when there are multiple elements with the same context. It allows the HLSL shader to differentiate between the elements. |
int | stream | [Optional] The stream number to use. |
Remarks
The start
and slot
values must be between 0 - 3, and the count
parameter must be between 1 - 4. If they are not, then an exception will be
raised.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
ArgumentOutOfRangeException | Thrown when the -or- Thrown when the |
Properties
| Edit this page View SourceComponentCount
Property to return the number of components of the entry to write out to.
Declaration
public byte ComponentCount { get; }
Property Value
Type | Description |
---|---|
byte |
Remarks
Valid values are 1 to 4.
Context
Property to return the context of the element.
Declaration
public string Context { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This is a string value that corresponds to a shader semantic. For example, to specify a normal, the user would set this to "Normal". With the exception of the position element (which must be named "SV_Position"), these contexts can be any name as long as it maps to a corresponding vertex element in the shader.
Index
Property to return The index of the context.
Declaration
public int Index { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
This is used to differentiate between elements with the same Context. For example, to define a 2nd set of texture coordinates, use the same Context for the element and define this value as 1 in the constructor.
Slot
Property to return the associated stream output buffer that is bound to the pipeline
Declaration
public int Slot { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
The valid range for OutputSlot is 0 to 3.
StartComponent
Property to return the component of the entry to begin writing out to.
Declaration
public byte StartComponent { get; }
Property Value
Type | Description |
---|---|
byte |
Remarks
Valid values are 0 to 3.
StreamIndex
Property to return the stream number to use.
Declaration
public int StreamIndex { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceEquals(GorgonStreamOutElement)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GorgonStreamOutElement other)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutElement | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the other parameter; otherwise, false. |
Equals(in GorgonStreamOutElement)
Function to compare this instance with another.
Declaration
public bool Equals(in GorgonStreamOutElement other)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutElement | other | The other instance to use for comparison. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(in GorgonStreamOutElement, in GorgonStreamOutElement)
Function to determine if two instances are equal.
Declaration
public static bool Equals(in GorgonStreamOutElement left, in GorgonStreamOutElement right)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutElement | left | The first instance to compare. |
GorgonStreamOutElement | right | The second instance to compare. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool | true if the specified object is equal to this instance; otherwise, false. |
Overrides
| Edit this page View SourceGetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
Operators
| Edit this page View Sourceoperator ==(in GorgonStreamOutElement, in GorgonStreamOutElement)
Implements the operator ==.
Declaration
public static bool operator ==(in GorgonStreamOutElement left, in GorgonStreamOutElement right)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutElement | left | The left. |
GorgonStreamOutElement | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator !=(in GorgonStreamOutElement, in GorgonStreamOutElement)
Implements the operator !=.
Declaration
public static bool operator !=(in GorgonStreamOutElement left, in GorgonStreamOutElement right)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutElement | left | The left. |
GorgonStreamOutElement | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |