Class GorgonStructuredView
A shader resource view for GorgonBuffer containing structured data.
Inheritance
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public sealed class GorgonStructuredView : 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 structured buffer resource. The buffer must have been created with the Shader flag in its Binding property, and have a StructureSize greater than 0.
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 depends on the size of an individual "structure" in the buffer (this structure size defined by the IGorgonBufferInfo type). Each element can be between 1-2048 bytes and will be aligned to a 4-byte boundary.
Properties
| Edit this page View SourceAllowCpuRead
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
| Edit this page View SourceBinding
Property to return the type of binding for the GPU.
Declaration
public BufferBinding Binding { get; }
Property Value
Type | Description |
---|---|
BufferBinding |
See Also
| Edit this page View SourceElementSize
Property to return the size of an element, in bytes.
Declaration
public override int ElementSize { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
See Also
| Edit this page View SourceIndirectArgs
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
| Edit this page View SourceStructureSize
Property to return the size, in bytes, of an individual structure in a structured buffer.
Declaration
public int StructureSize { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
This value will be rounded to the nearest multiple of 4.