diff --git a/libobs/graphics/effect-parser.c b/libobs/graphics/effect-parser.c index 56c462a51a4855ff52461b35447953a49a141bac..6f4d715789278ab1a1b4eab1c28fb96caf498ab6 100644 --- a/libobs/graphics/effect-parser.c +++ b/libobs/graphics/effect-parser.c @@ -819,7 +819,7 @@ static void ep_parse_param(struct effect_parser *ep, bool is_property, bool is_const, bool is_uniform) { struct ep_param param; - ep_param_init(¶m, type, name, is_property, is_const); + ep_param_init(¶m, type, name, is_property, is_const, is_uniform); if (token_is(&ep->cfp, ";")) goto complete; @@ -967,10 +967,12 @@ static inline void ep_write_param(struct dstr *shader, struct ep_param *param, if (param->is_const) { dstr_cat(shader, "const "); - } else { + } else if (param->is_uniform) { struct dstr new; dstr_init_copy(&new, param->name); darray_push_back(sizeof(struct dstr), used_params, &new); + + dstr_cat(shader, "uniform "); } dstr_cat(shader, param->type); @@ -1310,6 +1312,7 @@ static inline void ep_compile_pass_shaderparams(struct effect_parser *ep, for (i = 0; i < pass_params->num; i++) { struct dstr *param_name; struct pass_shaderparam *param; + int test; param_name = darray_item(sizeof(struct dstr), used_params, i); param = darray_item(sizeof(struct pass_shaderparam), diff --git a/libobs/graphics/effect-parser.h b/libobs/graphics/effect-parser.h index f2f177d5c6698eab7adbcfa4b5e7a13221c25d32..297f8ee1c1cb917e86606d86999d19cc503ba0a2 100644 --- a/libobs/graphics/effect-parser.h +++ b/libobs/graphics/effect-parser.h @@ -63,7 +63,7 @@ struct ep_param { DARRAY(uint8_t) default_val; DARRAY(char*) properties; struct effect_param *param; - bool is_const, is_property, is_texture, written; + bool is_const, is_property, is_uniform, is_texture, written; int writeorder, array_count; }; @@ -71,12 +71,13 @@ extern void ep_param_writevar(struct dstr *dst, struct darray *use_params); static inline void ep_param_init(struct ep_param *epp, char *type, char *name, - bool is_property, bool is_const) + bool is_property, bool is_const, bool is_uniform) { epp->type = type; epp->name = name; epp->is_property = is_property; epp->is_const = is_const; + epp->is_uniform = is_uniform; epp->is_texture = (astrcmp_n(epp->type, "texture", 7) == 0); epp->written = false; epp->writeorder = false;