Struct RentedFloatBuffer<T> ​
Namespace: ValveResourceFormat.Renderer.Utils
Assembly: Renderer.dll
A scratch buffer of T elements backed by an array rented from the shared pool, for data that is written as structs but handed to GL as floats.
public readonly ref struct RentedFloatBuffer<T> where T : unmanagedType Parameters ​
T
Element type the buffer is written as.
Remarks ​
Renting floats for every element type keeps all of the renderer's per-frame scratch buffers in the same pool buckets instead of one set of buckets per struct type. Dispose (preferably with using) to return the array to the pool.
Constructors ​
RentedFloatBuffer(int) ​
Rents a buffer of count elements.
public RentedFloatBuffer(int count)Parameters ​
count int
Number of T elements to fit.
Properties ​
FloatArray ​
Gets the rented array, for GL overloads that take a array. The pool hands out whole buckets, so this is usually longer than requested.
public float[] FloatArray { get; }Property Value ​
float[]
Span ​
Gets the requested elements. Exactly the requested length, unlike .
public Span<T> Span { get; }Property Value ​
Span<T>
Methods ​
Dispose() ​
Returns the rented array to the pool.
public void Dispose()
