Saves a call to calloc (the maximum size is small and known at
compile-time) and fixes a leak.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
assert(ubo_count >= 1);
size_t sz = sizeof(struct mali_uniform_buffer_meta) * ubo_count;
- struct mali_uniform_buffer_meta *ubos = calloc(sz, 1);
+ struct mali_uniform_buffer_meta ubos[PAN_MAX_CONST_BUFFERS];
/* Upload uniforms as a UBO */
ubos[0].size = MALI_POSITIVE((2 + uniform_count));
return 16 * 1024 * sizeof(float);
case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
- return 16;
+ return PAN_MAX_CONST_BUFFERS;
case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
return 0;
struct panfrost_resource;
struct panfrost_screen;
+/* Driver limits */
+#define PAN_MAX_CONST_BUFFERS 16
+
/* Flags for allocated memory */
/* This memory region is executable */