From ff2b07c0324ad1363210bbec11635487bcccfdf8 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Mon, 23 Mar 2020 20:38:30 -0700 Subject: [PATCH] libobs-opengl: Support 3D texelFetch --- libobs-opengl/gl-shaderparser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libobs-opengl/gl-shaderparser.c b/libobs-opengl/gl-shaderparser.c index f66e85258..59d2a5210 100644 --- a/libobs-opengl/gl-shaderparser.c +++ b/libobs-opengl/gl-shaderparser.c @@ -381,7 +381,9 @@ static bool gl_write_texture_code(struct gl_shader_parser *glsp, else if (cf_token_is(cfp, "Load")) { written = gl_write_texture_call(glsp, var, "texelFetch", false); dstr_cat(&glsp->gl_string, "("); - function_end = ").xy, 0)"; + function_end = (strcmp(var->type, "texture3d") == 0) + ? ").xyz, 0)" + : ").xy, 0)"; } if (!written)