Browse Source

libobs-opengl: Support 3D texelFetch

jpark37 5 years ago
parent
commit
ff2b07c032
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libobs-opengl/gl-shaderparser.c

+ 3 - 1
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)