Gorgon
Show / Hide Table of Contents

Class GorgonBufferReadWriteViewCommon<T>

Provides a read/write (unordered access) view for a GorgonBuffer, GorgonVertexBuffer or a GorgonIndexBuffer.

Inheritance
object
GorgonResourceView
GorgonReadWriteView
GorgonBufferReadWriteViewCommon<T>
GorgonBufferReadWriteView
GorgonIndexBufferReadWriteView
GorgonRawReadWriteView
GorgonStructuredReadWriteView
GorgonVertexBufferReadWriteView
Implements
IDisposable
IGorgonGraphicsObject
IEquatable<GorgonResourceView>
Inherited Members
GorgonReadWriteView.Clear(int, int, int, int)
GorgonReadWriteView.Clear(int)
GorgonReadWriteView.Clear(float, float, float, float)
GorgonReadWriteView.Clear(float)
GorgonReadWriteView.Clear(Vector4)
GorgonReadWriteView.Dispose()
GorgonResourceView.Log
GorgonResourceView.OwnsResource
GorgonResourceView.IsDisposed
GorgonResourceView.Resource
GorgonResourceView.Usage
GorgonResourceView.Graphics
GorgonResourceView.Equals(GorgonResourceView)
GorgonResourceView.Equals(object)
GorgonResourceView.GetHashCode()
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()
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 Source

GorgonBufferReadWriteViewCommon(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 buffer parameter is null.

See Also
GorgonGraphicsResource
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon

Properties

| Edit this page View Source

Buffer

Property to return the buffer associated with this view.

Declaration
public T Buffer { get; protected set; }
Property Value
Type Description
T
See Also
GorgonGraphicsResource
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

ElementCount

Property to return the number of elements in the view.

Declaration
public int ElementCount { get; }
Property Value
Type Description
int
See Also
GorgonGraphicsResource
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

ElementSize

Property to return the size of an element.

Declaration
public abstract int ElementSize { get; }
Property Value
Type Description
int
See Also
GorgonGraphicsResource
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

StartElement

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
GorgonGraphicsResource
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

TotalElementCount

Property to return the total number of elements in the Buffer.

Declaration
public int TotalElementCount { get; }
Property Value
Type Description
int
See Also
GorgonGraphicsResource
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon

Implements

IDisposable
IGorgonGraphicsObject
IEquatable<T>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

GorgonGraphicsResource
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
  • 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