Files
luma/Sources/CShaderTranslate/include/CShaderTranslate.h
Ole André Vadla Ravnås a1508524a0 Draw the author's own scene on a canvas
A scene the image holds by handle and changes; the host draws it.
Each drawable carries its own vertex and fragment stages, its own
attribute layout, named uniforms, buffers, a transform and a
visibility flag -- described as objects rather than staged globals.

A value says what it should do, ramp or oscillate, rather than what
it is each frame: nothing crosses per frame, since the image has no
business in the frame path any more than in the audio callback.
Both renderers work it out on the clock that draws it.
2026-08-13 12:46:09 +02:00

28 lines
869 B
C

#ifndef LUMA_CSHADERTRANSLATE_H
#define LUMA_CSHADERTRANSLATE_H
#ifdef __cplusplus
extern "C" {
#endif
// Translates a fragment shader authored in GLSL into Metal Shading Language,
// so an effect written in a snippet reaches a Metal host without a build step.
// GTK needs none of this: OpenGL takes the GLSL as it stands.
//
// Answers a malloc'd MSL string the caller frees, or NULL. On failure a
// malloc'd message is written to *error_message, which the caller frees too,
// so a mistyped shader can be reported where it was written.
#define LUMA_SHADER_STAGE_VERTEX 0
#define LUMA_SHADER_STAGE_FRAGMENT 1
char *luma_shader_translate_to_msl(const char *glsl,
int stage,
const char *entry_point,
char **error_message);
#ifdef __cplusplus
}
#endif
#endif