Interface IGorgonBufferInfo
Provides the necessary information required to set up a generic unstructured buffer.
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public interface IGorgonBufferInfo : IGorgonNamedObject
Remarks
This provides an immutable view of the buffer information so that it cannot be modified after the buffer is created.
Properties
| Edit this page View SourceAllowCpuRead
Property to set or return whether to allow the CPU read access to the buffer.
Declaration
bool AllowCpuRead { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This value controls 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.
The default for this value is false.
AllowRawView
Property to return whether to allow raw unordered views of the buffer.
Declaration
bool AllowRawView { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
When this value is true, then unordered access views for this buffer can use byte addressing to read/write the buffer in a shader. If it is false, then the SRV format or StructureSize will determine how to address data in the buffer.
The default value is false.
Binding
Property to return the type of binding for the GPU.
Declaration
BufferBinding Binding { get; }
Property Value
Type | Description |
---|---|
BufferBinding |
Remarks
The type of binding should be used to determine what type of view to apply to the buffer when accessing it from shaders. This will also help determine how data will be interpreted.
Different bindings may be applied at the same time by OR'ing the BufferBinding flags together.
If the Usage is set to Staging, then this value must be set to None, otherwise an exception will be raised when the buffer is created.
The default value is None
IndirectArgs
Property to return whether the buffer will contain indirect argument data.
Declaration
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.
SizeInBytes
Property to return the size of the buffer, in bytes.
Declaration
int SizeInBytes { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
For buffers that set AllowRawView to true, then this value will be rounded up to the nearest multiple of 4 at buffer creation time.
This value should be larger than 0, or else an exception will be thrown when the buffer is created.
StructureSize
Property to return the size, in bytes, of an individual structure in a structured buffer.
Declaration
int StructureSize { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Set this value to a number larger than 0 to indicate that this buffer will contain structured data.
This value should be larger than 0, and less than or equal to 2048 bytes. The structure size should also be a multiple of 4, and will be rounded up at buffer creation if it is not.
Vertex, Index and constant buffers will ignore this flag and will reset it to 0.
The default value is 0.
Usage
Property to return the intended usage for binding to the GPU.
Declaration
ResourceUsage Usage { get; }
Property Value
Type | Description |
---|---|
ResourceUsage |