sdk/common/NvBlastMemory.h File Reference

#include <math.h>

Go to the source code of this file.

Namespaces

namespace  Nv
namespace  Nv::Blast

Defines

#define NvBlastAllocaAligned16(x)   (void*)(((uintptr_t)PxAlloca(x + 0xF) + 0xF) & ~(uintptr_t)0xF)
#define NvBlastBlockArrayData(_dataType, _name, _accessor, _sizeExpr)
#define NvBlastBlockData(_dataType, _name, _accessor)
#define NvBlastCreateOffsetAlign16(_name, _size)
#define NvBlastCreateOffsetEndAlign16()   align16(_lastOffset + _lastSize)
#define NvBlastCreateOffsetStart(_baseOffset)

Functions

template<typename T >
NV_INLINE T Nv::Blast::align16 (T value)
template<typename T >
NV_INLINE T Nv::Blast::pointerOffset (const void *p, ptrdiff_t offset)
template<typename T >
NV_INLINE T Nv::Blast::pointerOffset (void *p, ptrdiff_t offset)


Define Documentation

#define NvBlastAllocaAligned16 (  )     (void*)(((uintptr_t)PxAlloca(x + 0xF) + 0xF) & ~(uintptr_t)0xF)

Stack allocation

#define NvBlastBlockArrayData ( _dataType,
_name,
_accessor,
_sizeExpr   ) 

Value:

_dataType* _accessor() const \
{ \
    return (_dataType*)((uintptr_t)this + _name); \
} \
uint32_t _accessor##ArraySize() const \
{ \
    return _sizeExpr; \
} \
uint32_t _name
Block data offset and accessor macro for an array (includes an _accessor#ArraySize() function which returns the last expression).

#define NvBlastBlockData ( _dataType,
_name,
_accessor   ) 

Value:

_dataType* _accessor() const \
{ \
    return (_dataType*)((uintptr_t)this + _name); \
} \
uint32_t _name
Block data offset and accessor macro.

#define NvBlastCreateOffsetAlign16 ( _name,
_size   ) 

Value:

_name = align16(_lastOffset + _lastSize); \
_lastOffset = _name; \
_lastSize = _size
Create the next offset generation with this. The value will be aligned to a 16-byte boundary.

 
#define NvBlastCreateOffsetEndAlign16 (  )     align16(_lastOffset + _lastSize)

End offset generation with this. It evaluates to the (16-byte aligned) total size of the data block.

#define NvBlastCreateOffsetStart ( _baseOffset   ) 

Value:

size_t _lastOffset = _baseOffset; \
size_t _lastSize = 0
Block data offset generation macros. Start offset generation with this.