return shader;
}
+GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base)
+{
+ const glslang::TResourceType res_type = glslang::TResourceType(res);
+ shader->shader->setShiftBinding(res_type, base);
+}
+
+GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set)
+{
+ const glslang::TResourceType res_type = glslang::TResourceType(res);
+ shader->shader->setShiftBindingForSet(res_type, base, set);
+}
+
+GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options)
+{
+ if (options & GLSLANG_SHADER_AUTO_MAP_BINDINGS) {
+ shader->shader->setAutoMapBindings(true);
+ }
+
+ if (options & GLSLANG_SHADER_AUTO_MAP_LOCATIONS) {
+ shader->shader->setAutoMapLocations(true);
+ }
+}
+
GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader)
{
return shader->preprocessedGLSL.c_str();
return (int)program->program->link((EShMessages)messages);
}
+GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program)
+{
+ return (int)program->program->mapIO();
+}
+
GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program)
{
return program->program->getInfoLog();
GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input);
GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader);
+GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base);
+GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set);
+GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t
GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input);
GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input);
GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader);
GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program);
GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader);
GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t
+GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program);
GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage);
GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program);
GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*);
LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT),
} glslang_profile_t;
+/* Shader options */
+typedef enum {
+ GLSLANG_SHADER_DEFAULT_BIT = 0,
+ GLSLANG_SHADER_AUTO_MAP_BINDINGS = (1 << 0),
+ GLSLANG_SHADER_AUTO_MAP_LOCATIONS = (2 << 0),
+ LAST_ELEMENT_MARKER(GLSLANG_SHADER_COUNT),
+} glslang_shader_options_t;
+
+/* TResourceType counterpart */
+typedef enum {
+ GLSLANG_RESOURCE_TYPE_SAMPLER,
+ GLSLANG_RESOURCE_TYPE_TEXTURE,
+ GLSLANG_RESOURCE_TYPE_IMAGE,
+ GLSLANG_RESOURCE_TYPE_UBO,
+ GLSLANG_RESOURCE_TYPE_SSBO,
+ GLSLANG_RESOURCE_TYPE_UAV,
+ LAST_ELEMENT_MARKER(GLSLANG_RESOURCE_TYPE_COUNT),
+} glslang_resource_type_t;
+
#undef LAST_ELEMENT_MARKER
#endif