summaryrefslogtreecommitdiffstats
path: root/tools/glsl_preproc/templates/call.c.j2
diff options
context:
space:
mode:
Diffstat (limited to 'tools/glsl_preproc/templates/call.c.j2')
-rw-r--r--tools/glsl_preproc/templates/call.c.j219
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/glsl_preproc/templates/call.c.j2 b/tools/glsl_preproc/templates/call.c.j2
new file mode 100644
index 0000000..61ee6c0
--- /dev/null
+++ b/tools/glsl_preproc/templates/call.c.j2
@@ -0,0 +1,19 @@
+{
+{% if macro.vars %}
+ const {{ macro.render_struct() }} {{ macro.name }}_args = {
+ {% for var in macro.vars %}
+#line {{ var.linenr }}
+ .{{ var.name }} = {{ var.expr }},
+ {% endfor %}
+ };
+#line {{ macro.linenr }}
+{% endif %}
+ size_t {{ macro.name }}_fn(void *, pl_str *, const uint8_t *);
+{% if macro.vars %}
+ pl_str_builder_append(sh->buffers[{{ macro.buf }}], {{ macro.name }}_fn,
+ &{{ macro.name }}_args, sizeof({{ macro.name }}_args));
+{% else %}
+ pl_str_builder_append(sh->buffers[{{ macro.buf }}], {{ macro.name }}_fn, NULL, 0);
+{% endif %}
+}
+