Show / Hide Table of Contents

Class StorageBuffer<T>

CPU side implementation for using Shader Storage Buffer Objects.

Inheritance
System.Object
StorageBuffer<T>
Implements
IStorageBuffer
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Fusee.Engine.Core.Effects
Assembly: Fusee.Engine.Core.dll
Syntax
public class StorageBuffer<T> : IStorageBuffer, IDisposable where T : struct
Type Parameters
Name Description
T

The data type of the payload.

Constructors

StorageBuffer(RenderCanvas, Int32, Int32, Int32)

Creates a new instance of type StorageBuffer.

Declaration
public StorageBuffer(RenderCanvas rc, int count, int tSize, int blockBindingIndex)
Parameters
Type Name Description
RenderCanvas rc

The RenderContext this object is used with.

System.Int32 count

The (fixed) count of buffer elements.

System.Int32 tSize

The size (byte) of one buffer element.

System.Int32 blockBindingIndex

Int that needs to be unique throughout the shader.

Properties

BindingIndex

The binding index point the SSBO will be bound to. Caution: the binding point should not be hard coded in the shader code!

Declaration
public int BindingIndex { get; set; }
Property Value
Type Description
System.Int32

BufferHandle

The handle of the buffer on the GPU.

Declaration
public IBufferHandle BufferHandle { get; set; }
Property Value
Type Description
IBufferHandle

Count

Return the number of buffer elements.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Item[Int32]

Declaration
public T this[int index] { get; }
Parameters
Type Name Description
System.Int32 index
Property Value
Type Description
T

Size

Return the size in byte for one buffer element.

Declaration
public int Size { get; }
Property Value
Type Description
System.Int32

Methods

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

SetData(T[])

Sets the buffer contents on the gpu.

Declaration
public void SetData(T[] data)
Parameters
Type Name Description
T[] data

The data that needs to be sent the gpu.

Implements

IStorageBuffer
System.IDisposable
Generated by DocFX
GitHub Repo
Back to top