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.
This commit is contained in:
parent
1f39b6a612
commit
92af243a27
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user