Gorgon
Show / Hide Table of Contents

Class GorgonReadWriteView

An readable and writable (unordered access) view for a GorgonGraphicsResource.

Inheritance
object
GorgonResourceView
GorgonReadWriteView
GorgonBufferReadWriteViewCommon<T>
GorgonTexture1DReadWriteView
GorgonTexture2DReadWriteView
GorgonTexture3DReadWriteView
Implements
IDisposable
IGorgonGraphicsObject
IEquatable<GorgonResourceView>
Inherited Members
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 GorgonReadWriteView : GorgonResourceView, IDisposable, IGorgonGraphicsObject, IEquatable<GorgonResourceView>
Remarks

This type of view allows for unordered access to a GorgonGraphicsResource like one of the GorgonBuffer types, a texture, etc... Any resource that needs a unordered access must be created with the the UnorderedAccess flag.

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.

warning

Unordered access views do not support a multisampled GorgonTexture2D.

Constructors

| Edit this page View Source

GorgonReadWriteView(GorgonGraphicsResource)

Initializes a new instance of the GorgonShaderResourceView class.

Declaration
protected GorgonReadWriteView(GorgonGraphicsResource resource)
Parameters
Type Name Description
GorgonGraphicsResource resource

The resource to bind to the view.

Exceptions
Type Condition
ArgumentNullException

Thrown when the resource parameter is null.

See Also
GorgonGraphicsResource
GorgonBuffer
GorgonTexture2D
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon

Methods

| Edit this page View Source

Clear(int)

Function to clear the unordered access value with the specified value.

Declaration
public void Clear(int value)
Parameters
Type Name Description
int value

Value used to clear.

Remarks

This method will copy the lower n[i] bits (where n is the number of bits in a channel, i is the index of the channel) to the proper channel.

This method works on any unordered access view that does not require format conversion.

See Also
GorgonGraphicsResource
GorgonBuffer
GorgonTexture2D
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

Clear(int, int, int, int)

Function to clear the unordered access value with the specified values.

Declaration
public void Clear(int value1, int value2, int value3, int value4)
Parameters
Type Name Description
int value1

First value.

int value2

Second value.

int value3

Third value.

int value4

Fourth value.

Remarks

This method will copy the lower n[i] bits (where n is the number of bits in a channel, i is the index of the channel) to the proper channel.

This method works on any unordered access view that does not require format conversion. Unordered access views for raw/structured buffers only use the first value.

See Also
GorgonGraphicsResource
GorgonBuffer
GorgonTexture2D
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

Clear(Vector4)

Function to clear the unordered access value with the specified values.

Declaration
public void Clear(Vector4 values)
Parameters
Type Name Description
Vector4 values

Values used to clear.

Remarks

This method will copy the lower n[i] bits (where n is the number of bits in a channel, i is the index of the channel) to the proper channel.

This method works on any unordered access view that does not require format conversion. Unordered access views for raw/structured buffers only use the first value in the vector.

See Also
GorgonGraphicsResource
GorgonBuffer
GorgonTexture2D
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

Clear(float)

Function to clear the unordered access value with the specified value.

Declaration
public void Clear(float value)
Parameters
Type Name Description
float value

Value used to clear.

Remarks

This method will copy the lower n[i] bits (where n is the number of bits in a channel, i is the index of the channel) to the proper channel.

This method works on any unordered access view that does not require format conversion.

See Also
GorgonGraphicsResource
GorgonBuffer
GorgonTexture2D
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

Clear(float, float, float, float)

Function to clear the unordered access value with the specified values.

Declaration
public void Clear(float value1, float value2, float value3, float value4)
Parameters
Type Name Description
float value1

First value.

float value2

Second value.

float value3

Third value.

float value4

Fourth value.

Remarks

This method will copy the lower n[i] bits (where n is the number of bits in a channel, i is the index of the channel) to the proper channel.

This method works on any unordered access view that does not require format conversion. Unordered access views for raw/structured buffers only use the first value.

See Also
GorgonGraphicsResource
GorgonBuffer
GorgonTexture2D
GorgonComputeShader
GorgonPixelShader
GorgonDrawCallCommon
| Edit this page View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public override void Dispose()
Overrides
GorgonResourceView.Dispose()
See Also
GorgonGraphicsResource
GorgonBuffer
GorgonTexture2D
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
GorgonBuffer
GorgonTexture2D
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