glsl: remove unused state variable
authorcheyang <cheyang@bytedance.com>
Sun, 20 Dec 2020 13:00:46 +0000 (21:00 +0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 21 Dec 2020 14:49:53 +0000 (14:49 +0000)
Because compile_shader function state variable
not determine whether the compilation is successful.

Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8178>

src/compiler/glsl/standalone.cpp

index 653f380..b34583e 100644 (file)
@@ -380,15 +380,12 @@ load_text_file(void *ctx, const char *file_name)
 static void
 compile_shader(struct gl_context *ctx, struct gl_shader *shader)
 {
-   struct _mesa_glsl_parse_state *state =
-      new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader);
-
    _mesa_glsl_compile_shader(ctx, shader, options->dump_ast,
                              options->dump_hir, true);
 
    /* Print out the resulting IR */
-   if (!state->error && options->dump_lir) {
-      _mesa_print_ir(stdout, shader->ir, state);
+   if (shader->CompileStatus == COMPILE_SUCCESS && options->dump_lir) {
+      _mesa_print_ir(stdout, shader->ir, NULL);
    }
 
    return;