GpuBufferBase
Description
- Derived from
-
ResourceBase abstract
IGpuBuffer
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:
-
Override only DoBufferUpdate:
All buffer updates will be routed through this method, translating usages of IGpuBuffer.BufferMap, IGpuBuffer.BufferPrepare and IGpuBuffer.BufferUnmap transparently. -
Override only DoBufferMap and DoBufferUnmap:
All buffer updates will be routed through these methods, translating usages of IGpuBuffer.BufferUpdateArray and IGpuBuffer.BufferUpdate transparently. -
Override all of the three above:
For each buffer update, DoBufferMap is called first:
if it returns IntPtr.Zero, then the update will be performed via DoBufferUpdate.
Otherwise, the update will be performed via IGpuBuffer.BufferPrepare and finally DoBufferUnmap.
Public / Methods
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 / Methods
AccessPatternFor
Returns the ResourceAccessPattern that corresponds to the given GPU buffer flags.