libobs: Add HLSL annotation parsing

Gives the ability to retrieve param annotations. Blocks wrapped in <>
following a parameter.

For example:
float slider < float max_value = 10.0; float min_value = 0.0; >;

These blocks are not for shading purposes but to help describe the
shader's gui as in the example above.

Adds graphics api functions for retrieving annotations:
size_t gs_param_get_num_annotations(const gs_eparam_t *param);

gs_eparam_t *gs_param_get_annotation_by_idx(const gs_eparam_t *param,
		size_t annotation);

gs_eparam_t *gs_param_get_annotation_by_name(const gs_eparam_t *param,
		const char *name);
This commit is contained in:
Alex Anderson
2018-06-09 00:26:06 -07:00
parent a8517f3698
commit af67086912
6 changed files with 388 additions and 37 deletions

View File

@@ -137,8 +137,11 @@ void gs_shader::BuildConstantBuffer()
case GS_SHADER_PARAM_BOOL:
case GS_SHADER_PARAM_INT:
case GS_SHADER_PARAM_FLOAT: size = sizeof(float); break;
case GS_SHADER_PARAM_INT2:
case GS_SHADER_PARAM_VEC2: size = sizeof(vec2); break;
case GS_SHADER_PARAM_INT3:
case GS_SHADER_PARAM_VEC3: size = sizeof(float)*3; break;
case GS_SHADER_PARAM_INT4:
case GS_SHADER_PARAM_VEC4: size = sizeof(vec4); break;
case GS_SHADER_PARAM_MATRIX4X4:
size = sizeof(float)*4*4;