Gorgon
Show / Hide Table of Contents

Class GorgonRawView

A shader resource view for a GorgonBuffer.

Inheritance
object
GorgonResourceView
GorgonShaderResourceView
GorgonBufferViewCommon
GorgonRawView
Implements
IDisposable
IGorgonGraphicsObject
IEquatable<GorgonResourceView>
IEquatable<GorgonShaderResourceView>
IGorgonBufferInfo
IGorgonNamedObject
Inherited Members
GorgonBufferViewCommon.Buffer
GorgonBufferViewCommon.StartElement
GorgonBufferViewCommon.ElementCount
GorgonBufferViewCommon.TotalElementCount
GorgonBufferViewCommon.Dispose()
GorgonShaderResourceView.Equals(GorgonShaderResourceView)
GorgonShaderResourceView.Equals(object)
GorgonShaderResourceView.GetHashCode()
GorgonResourceView.IsDisposed
GorgonResourceView.Resource
GorgonResourceView.Usage
GorgonResourceView.Graphics
GorgonResourceView.Equals(GorgonResourceView)
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public sealed class GorgonRawView : GorgonBufferViewCommon, IDisposable, IGorgonGraphicsObject, IEquatable<GorgonResourceView>, IEquatable<GorgonShaderResourceView>, IGorgonBufferInfo, IGorgonNamedObject
Remarks

This is a generic view to allow a GorgonBuffer to be bound to the GPU pipeline as a raw byte buffer resource. The buffer must have been created with the Shader flag in its Binding property, and the AllowRawView flag must have been set to true.

Use a resource view to allow a shader access to the contents of a resource (or sub resource). When the resource is created with a typeless format, this will allow the resource to be cast to any format within the same group.

This type of view will allow shaders to access the data in the buffer by treating each data item as an "element". The size of these elements is always 4 bytes and can be interpreted as a specific type of data (signed integer, unsigned integer, and single floating point precision) which is defined via the RawBufferElementType enumeration.

Properties

| Edit this page View Source

AllowCpuRead

Property to set or return whether to allow the CPU read access to the buffer.

Declaration
public bool AllowCpuRead { get; }
Property Value
Type Description
bool
Remarks

This value indicates whether or not the CPU can directly access the buffer for reading. If this value is false, the buffer still can be read, but will be done through an intermediate staging buffer, which is obviously less performant.

This value is treated as false if the buffer does not have a Binding containing the Shader flag, and does not have a Usage of Default. This means any reads will be done through an intermediate staging buffer, impacting performance.

If the Usage property is set to Staging, then this value is treated as true because staging buffers are CPU only and as such, can be read directly by the CPU regardless of this value.

See Also
GorgonBuffer
| Edit this page View Source

AllowRawView

Property to return whether to allow raw unordered views of the buffer.

Declaration
public bool AllowRawView { get; }
Property Value
Type Description
bool
Remarks

This value is always false for this type of view.

See Also
GorgonBuffer
| Edit this page View Source

Binding

Property to return the type of binding for the GPU.

Declaration
public BufferBinding Binding { get; }
Property Value
Type Description
BufferBinding
See Also
GorgonBuffer
| Edit this page View Source

ElementSize

Property to return the size of an element, in bytes.

Declaration
public override int ElementSize { get; }
Property Value
Type Description
int
Overrides
GorgonBufferViewCommon.ElementSize
Remarks

For a raw buffer view, this will always be 4.

See Also
GorgonBuffer
| Edit this page View Source

ElementType

Property to return the type of elements in the buffer.

Declaration
public RawBufferElementType ElementType { get; }
Property Value
Type Description
RawBufferElementType
See Also
GorgonBuffer
| Edit this page View Source

IndirectArgs

Property to return whether the buffer will contain indirect argument data.

Declaration
public bool IndirectArgs { get; }
Property Value
Type Description
bool
Remarks

This flag only applies to buffers with a Binding of ReadWrite, and/or Shader. If the binding is set to anything else, then this flag is treated as being set to false.

The default value is false.

See Also
GorgonBuffer

Implements

IDisposable
IGorgonGraphicsObject
IEquatable<T>
IEquatable<T>
IGorgonBufferInfo
IGorgonNamedObject

Extension Methods

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

See Also

GorgonBuffer
  • 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