提交 92af243a 编写于 作者: J jp9000

libobs-opengl: Fix bug with texelFetch shader intrinsic

This is supposed to assign -1 to the sampler_id to indicate that no
sampler need be assigned for the texture, but instead it was leaving the
variable with uninitialized data, resulting in a crash when used.
上级 1f39b6a6
......@@ -312,11 +312,12 @@ static inline bool gl_write_texture_call(struct gl_shader_parser *glsp,
if (!cf_next_token(cfp)) return false;
sampler_id = sp_getsampler(glsp, cfp->cur_token);
if (sampler_id == (size_t) -1) return false;
var->gl_sampler_id = sampler_id;
if (!cf_next_token(cfp)) return false;
if (!cf_token_is(cfp, ",")) return false;
}
var->gl_sampler_id = sampler_id;
dstr_cat(&glsp->gl_string, call);
dstr_cat(&glsp->gl_string, "(");
dstr_cat(&glsp->gl_string, var->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册