84 return input_a->
type < input_b->
type ? 1 : 0;
95#define MAX_UBO_GPU_TYPE GPU_MAT4
122 if (input->type == cur_type) {
126 inputs_lookup[input->type] = link;
127 cur_type = input->type;
131 if (inputs_lookup[
GPU_VEC3] ==
nullptr) {
145 if (inputs_lookup[
GPU_FLOAT] !=
nullptr) {
155#undef MAX_UBO_GPU_TYPE
160 size_t buffer_size = 0;
163 buffer_size += gputype *
sizeof(
float);
166 size_t alignment =
sizeof(
float[4]);
167 buffer_size =
divide_ceil_u(buffer_size, alignment) * alignment;
175 float *offset = (
float *)data;
178 memcpy(offset, input->vec, input->type *
sizeof(
float));
195 if (data !=
nullptr) {
226 unwrap(ubo)->update(data);
236 unwrap(ubo)->bind_as_ssbo(slot);
251 unwrap(ubo)->clear_to_zero();
#define BLI_assert_msg(a, msg)
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)
MINLINE uint divide_ceil_u(uint a, uint b)
#define STRNCPY(dst, src)
eGPUBackendType GPU_backend_get_type()
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
virtual void debug_unbind_all_ubo()=0
static GPUBackend * get()
virtual UniformBuf * uniformbuf_alloc(size_t size, const char *name)=0
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
void *(* MEM_mallocN)(size_t len, const char *str)
static Context * unwrap(GPUContext *ctx)
static GPUContext * wrap(Context *ctx)