Class GPUMeshBufferCache
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Caches GPU mesh buffers and vertex array objects for efficient mesh rendering.
public class GPUMeshBufferCacheInheritance
Constructors
GPUMeshBufferCache(RendererContext)
Initializes a new GPU mesh buffer cache.
public GPUMeshBufferCache(RendererContext rendererContext)Parameters
rendererContext RendererContext
The renderer context owning this cache.
Properties
EmptyVAO
Gets a lazily created empty vertex array object with no attributes, used for attributeless draws.
public int EmptyVAO { get; }Property Value
QuadIndices
Gets the shared quad index buffer used for rendering quad-based geometry as triangle pairs.
public QuadIndexBuffer QuadIndices { get; }Property Value
VectorOneVertexBuffer
Gets a lazily created vertex buffer containing a single (1, 1, 1, 1) float4, used as a default color attribute.
public int VectorOneVertexBuffer { get; }Property Value
Methods
Clear()
Disposes any cached gpu buffers and frees gpu vertex arrays.
public void Clear()CreateVertexIndexBuffers(string, VBIB)
Returns cached GPU buffers for the named mesh, uploading them if not yet present.
public GPUMeshBuffers CreateVertexIndexBuffers(string meshName, VBIB vbib)Parameters
meshName string
Unique name identifying the mesh.
vbib VBIB
Vertex and index buffer data to upload on first use.
Returns
The GPU buffers for the mesh.
DeleteVertexIndexBuffers(string)
Deletes and removes the cached GPU buffers for the specified mesh.
public void DeleteVertexIndexBuffers(string meshName)Parameters
meshName string
Unique name identifying the mesh to delete.
GetVertexArrayObject(string, VertexDrawBuffer[], RenderMaterial, int)
Returns a cached VAO for the given mesh/shader/buffer combination, creating it if necessary.
public int GetVertexArrayObject(string meshName, VertexDrawBuffer[] vertexBuffers, RenderMaterial material, int idxIndex)Parameters
meshName string
Name of the mesh whose buffers are used.
vertexBuffers VertexDrawBuffer[]
Vertex buffer bindings for the draw call.
material RenderMaterial
Material whose shader determines attribute locations.
idxIndex int
OpenGL handle of the index buffer.
Returns
The OpenGL VAO handle.

