92 return input_a->
type < input_b->type ? 1 : 0;
103 #define MAX_UBO_GPU_TYPE GPU_MAT4
125 if (input->
type == cur_type) {
129 inputs_lookup[input->
type] = link;
130 cur_type = input->
type;
134 if (inputs_lookup[
GPU_VEC3] ==
nullptr) {
148 if (inputs_lookup[
GPU_FLOAT] !=
nullptr) {
158 #undef MAX_UBO_GPU_TYPE
163 size_t buffer_size = 0;
166 buffer_size += gputype *
sizeof(
float);
169 size_t alignment =
sizeof(
float[4]);
170 buffer_size =
divide_ceil_u(buffer_size, alignment) * alignment;
178 float *offset = (
float *)
data;
181 memcpy(offset, input->
vec, input->
type *
sizeof(
float));
198 if (
data !=
nullptr) {
typedef float(TangentPoint)[2]
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void void BLI_listbase_sort(struct ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
virtual UniformBuf * uniformbuf_alloc(int size, const char *name)=0
static GPUBackend * get(void)
void *(* MEM_mallocN)(size_t len, const char *str)
MINLINE uint divide_ceil_u(uint a, uint b)
static GPUContext * wrap(Context *ctx)
static Context * unwrap(GPUContext *ctx)
static bNodeSocketTemplate inputs[]