Class GorgonBufferReadWriteViewCommon<T>
Provides a read/write (unordered access) view for a GorgonBuffer, GorgonVertexBuffer or a GorgonIndexBuffer.
Inheritance
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public abstract class GorgonBufferReadWriteViewCommon<T> : GorgonReadWriteView, IDisposable, IGorgonGraphicsObject, IEquatable<GorgonResourceView> where T : GorgonBufferCommon
Type Parameters
Name | Description |
---|---|
T | The type of buffer for this view. Must inherit from GorgonBufferCommon. |
Remarks
This type of view allows for unordered access to a buffer. The buffer must have been created with the ReadWrite flag in its binding property.
The unordered access allows a shader to read/write any part of a GorgonGraphicsResource by multiple threads without memory contention. This is done through the use of atomic functions.
These types of views are most useful for GorgonComputeShader shaders, but can also be used by a GorgonPixelShader by passing a list of these views in to a draw call.
Constructors
| Edit this page View SourceGorgonBufferReadWriteViewCommon(T, int, int, int)
Initializes a new instance of the GorgonBufferReadWriteViewCommon<T> class.
Declaration
protected GorgonBufferReadWriteViewCommon(T buffer, int elementStart, int elementCount, int totalElementCount)
Parameters
Type | Name | Description |
---|---|---|
T | buffer | The buffer to assign to the view. |
int | elementStart | The first element in the buffer to view. |
int | elementCount | The number of elements in the view. |
int | totalElementCount | The total number of elements in the buffer. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
Properties
| Edit this page View SourceBuffer
Property to return the buffer associated with this view.
Declaration
public T Buffer { get; protected set; }
Property Value
Type | Description |
---|---|
T |
See Also
| Edit this page View SourceElementCount
Property to return the number of elements in the view.
Declaration
public int ElementCount { get; }
Property Value
Type | Description |
---|---|
int |
See Also
| Edit this page View SourceElementSize
Property to return the size of an element.
Declaration
public abstract int ElementSize { get; }
Property Value
Type | Description |
---|---|
int |
See Also
| Edit this page View SourceStartElement
Property to return the offset of the view from first element in the buffer.
Declaration
public int StartElement { get; }
Property Value
Type | Description |
---|---|
int |
See Also
| Edit this page View SourceTotalElementCount
Property to return the total number of elements in the Buffer.
Declaration
public int TotalElementCount { get; }
Property Value
Type | Description |
---|---|
int |