abstract class Tinman.Terrain.Rendering.GpuBufferBase

Derived from

ResourceBase abstract

Abstract base class for IGpuBuffer implementations.

Depending on the capabilities of the underlying graphics API and the resource type of the GPU buffer, an implementing classes may choose to do one of the following:

Public / Methods


public method ForceStatic → ()

Forces the access pattern of this GPU buffer to ResourceAccessPattern.Static.

This method will not affect the underlying GPU resource, it will just modify the behaviour of this IGpuBuffer object.

Protected / Constructors


protected constructor GpuBufferBase → (3)

capacity in : int32

The buffer capacity, in elements.

elementSize in : int32

The buffer element size, in bytes.

accessPattern in : ResourceAccessPattern

The buffer access pattern.

Creates a new instance of GpuBufferBase.

Protected / Methods


protected static method AccessPatternFor → (1)

flags in : GpuBufferFlags

The GPU buffer flags.

returns → ResourceAccessPattern

The resource access flags.

Returns the ResourceAccessPattern that corresponds to the given GPU buffer flags.


protected virtual method DoBufferMap → (1)

flag in : GpuUpdateFlag

The buffer update flag.

returns → IntPtr

Pointer to the locked buffer content or IntPtr.Zero to use the copy mechanism via DoBufferUpdate instead.

Locks the buffer content.


protected virtual method DoBufferUnmap → (2)

pointer in : IntPtr

Pointer to the locked buffer content, as returned by DoBufferMap).

updated in : RangeI

The byte range that has been updated.

Unlocks the buffer content.


protected virtual method DoBufferUpdate → (3)

source in : IntPtr

Pointer to source data.

target in : int32

Byte offset into buffer content.

count in : int32

Number of bytes to update.

Updates the buffer content, ensuring GpuUpdateFlag.Discard semantics.