XLE  v0.02.0
Typedefs | Enumerations
BufferUploads::CPUAccess Namespace Reference

Container for CPUAccess::Enum. More...

Typedefs

typedef unsigned BitField
 

Enumerations

enum  Enum { Read = 1<<0, Write = 1<<1, WriteDynamic = (1<<2)|Write }
 Determines CPU access privileges More...
 

Detailed Description

Container for CPUAccess::Enum.

Enumeration Type Documentation

Determines CPU access privileges

Determines what access (if any) the CPU will have to the buffer. This can control how the object is stored in memory in into what memory it is stored.

It is always a good idea to use as few flags as possible. Many buffers should be fine with a CPUAccess flag of "0".

Note that this flag can change how the system performs upload operations. For example, in D3D11, when the CPUAccess::WriteDynamic flag is set, UpdateSubresource() can't be used to some types of buffers. In these cases, Map() is used instead.

Try to avoid "WriteDynamic" unless the buffer will be Locked multiple times per frame. If a buffer only needs to be updated once per frame (or less), use CPUAccess::Write

Enumerator
Read 

CPU can read from this resource (using IManager::Resource_Readback)

Write 

CPU can write to this resource, but will only do so once (or less) per frame.

WriteDynamic 

CPU can write to this resource, and will lock it multiple times during a single per frame.