Mesa (master): glsl: remove unused state variable

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 21 15:24:14 UTC 2020


Module: Mesa
Branch: master
Commit: ffe87c2689f369b3dfc067607f294d5e739ebb8b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffe87c2689f369b3dfc067607f294d5e739ebb8b

Author: cheyang <cheyang at bytedance.com>
Date:   Sun Dec 20 21:00:46 2020 +0800

glsl: remove unused state variable

Because compile_shader function state variable
not determine whether the compilation is successful.

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

---

 src/compiler/glsl/standalone.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index 653f3801e2b..b34583e54bd 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -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;



More information about the mesa-commit mailing list