Gorgon
Show / Hide Table of Contents

Struct GorgonStreamOutElement

A stream out element for a stream out buffer.

Implements
IGorgonNamedObject
IGorgonEquatableByRef<GorgonStreamOutElement>
IEquatable<GorgonStreamOutElement>
Inherited Members
ValueType.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
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 Source

GorgonStreamOutElement(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 context parameter is null.

ArgumentEmptyException

Thrown when the context parameter is empty.

ArgumentOutOfRangeException

Thrown when the start or slot parameter is less than 0 or greater than 3.

-or-

Thrown when the count parameter is less than 1 or greater than 4.

Properties

| Edit this page View Source

ComponentCount

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

StreamIndex

Property to return the stream number to use.

Declaration
public int StreamIndex { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

Equals(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

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
ValueType.GetHashCode()

Operators

| Edit this page View Source

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.

| Edit this page View Source

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.

Implements

IGorgonNamedObject
IGorgonEquatableByRef<T>
IEquatable<T>

Extension Methods

GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author