Mesa (master): mesa: change gl_compile_status enums to uppercase

Brian Paul brianp at kemper.freedesktop.org
Fri Jan 26 20:54:21 UTC 2018


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

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jan 25 12:43:48 2018 -0700

mesa: change gl_compile_status enums to uppercase

To follow the convention of other enums.

Reviewed-by: Neha Bhende <bhenden at vmware.com>

---

 src/compiler/glsl/glsl_parser_extras.cpp | 14 +++++++-------
 src/compiler/glsl/shader_cache.cpp       |  2 +-
 src/mesa/drivers/common/meta.c           |  2 +-
 src/mesa/main/ff_fragment_shader.cpp     |  2 +-
 src/mesa/main/glspirv.c                  |  2 +-
 src/mesa/main/mtypes.h                   |  8 ++++----
 src/mesa/main/shaderapi.c                |  4 ++--
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index 59821732b9..2e69fa95a5 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1971,7 +1971,7 @@ opt_shader_and_create_symbol_table(struct gl_context *ctx,
                                    struct glsl_symbol_table *source_symbols,
                                    struct gl_shader *shader)
 {
-   assert(shader->CompileStatus != compile_failure &&
+   assert(shader->CompileStatus != COMPILE_FAILURE &&
           !shader->ir->is_empty());
 
    struct gl_shader_compiler_options *options =
@@ -2048,7 +2048,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
                _mesa_sha1_format(buf, shader->sha1);
                fprintf(stderr, "deferring compile of shader: %s\n", buf);
             }
-            shader->CompileStatus = compile_skipped;
+            shader->CompileStatus = COMPILE_SKIPPED;
 
             free((void *)shader->FallbackSource);
             shader->FallbackSource = NULL;
@@ -2060,14 +2060,14 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
        * shader cache miss. In which case we can skip the compile if its
        * already be done by a previous fallback or the initial compile call.
        */
-      if (shader->CompileStatus == compile_success)
+      if (shader->CompileStatus == COMPILE_SUCCESS)
          return;
 
-      if (shader->CompileStatus == compiled_no_opts) {
+      if (shader->CompileStatus == COMPILED_NO_OPTS) {
          opt_shader_and_create_symbol_table(ctx,
                                             NULL, /* source_symbols */
                                             shader);
-         shader->CompileStatus = compile_success;
+         shader->CompileStatus = COMPILE_SUCCESS;
          return;
       }
    }
@@ -2117,7 +2117,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
       set_shader_inout_layout(shader, state);
 
    shader->symbols = new(shader->ir) glsl_symbol_table;
-   shader->CompileStatus = state->error ? compile_failure : compile_success;
+   shader->CompileStatus = state->error ? COMPILE_FAILURE : COMPILE_SUCCESS;
    shader->InfoLog = state->info_log;
    shader->Version = state->language_version;
    shader->IsES = state->es_shader;
@@ -2130,7 +2130,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
          opt_shader_and_create_symbol_table(ctx, state->symbols, shader);
       else {
          reparent_ir(shader->ir, shader->ir);
-         shader->CompileStatus = compiled_no_opts;
+         shader->CompileStatus = COMPILED_NO_OPTS;
       }
    }
 
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index 5e1682b351..bdc045e1db 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -258,7 +258,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
     */
    char sha1_buf[41];
    for (unsigned i = 0; i < prog->NumShaders; i++) {
-      if (prog->Shaders[i]->CompileStatus == compiled_no_opts) {
+      if (prog->Shaders[i]->CompileStatus == COMPILED_NO_OPTS) {
          disk_cache_put_key(cache, prog->Shaders[i]->sha1);
          if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {
             _mesa_sha1_format(sha1_buf, prog->Shaders[i]->sha1);
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index f4830ec28a..a48f700026 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -137,7 +137,7 @@ meta_compile_shader_with_debug(struct gl_context *ctx, gl_shader_stage stage,
 
    sh = _mesa_new_shader(name, stage);
    sh->Source = strdup(source);
-   sh->CompileStatus = compile_failure;
+   sh->CompileStatus = COMPILE_FAILURE;
    _mesa_compile_shader(ctx, sh);
 
    if (!sh->CompileStatus) {
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index 83541a269a..2be3ae37de 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1116,7 +1116,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key)
 
    reparent_ir(p.shader->ir, p.shader->ir);
 
-   p.shader->CompileStatus = compile_success;
+   p.shader->CompileStatus = COMPILE_SUCCESS;
    p.shader->Version = state->language_version;
    p.shader_program->Shaders =
       (gl_shader **)malloc(sizeof(*p.shader_program->Shaders));
diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c
index 81303057d0..03f761219b 100644
--- a/src/mesa/main/glspirv.c
+++ b/src/mesa/main/glspirv.c
@@ -84,7 +84,7 @@ _mesa_spirv_shader_binary(struct gl_context *ctx,
       _mesa_shader_spirv_data_reference(&sh->spirv_data, spirv_data);
       _mesa_spirv_module_reference(&spirv_data->SpirVModule, module);
 
-      sh->CompileStatus = compile_failure;
+      sh->CompileStatus = COMPILE_FAILURE;
 
       free((void *)sh->Source);
       sh->Source = NULL;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 15c6d1ade7..d6d3a07591 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2609,10 +2609,10 @@ struct gl_linked_shader
  */
 enum gl_compile_status
 {
-   compile_failure = 0,
-   compile_success,
-   compile_skipped,
-   compiled_no_opts
+   COMPILE_FAILURE = 0,
+   COMPILE_SUCCESS,
+   COMPILE_SKIPPED,
+   COMPILED_NO_OPTS
 };
 
 /**
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 2c11e4d5bb..91b1f4940e 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1071,7 +1071,7 @@ set_shader_source(struct gl_shader *sh, const GLchar *source)
     */
    _mesa_shader_spirv_data_reference(&sh->spirv_data, NULL);
 
-   if (sh->CompileStatus == compile_skipped && !sh->FallbackSource) {
+   if (sh->CompileStatus == COMPILE_SKIPPED && !sh->FallbackSource) {
       /* If shader was previously compiled back-up the source in case of cache
        * fallback.
        */
@@ -1114,7 +1114,7 @@ _mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh)
       /* If the user called glCompileShader without first calling
        * glShaderSource, we should fail to compile, but not raise a GL_ERROR.
        */
-      sh->CompileStatus = compile_failure;
+      sh->CompileStatus = COMPILE_FAILURE;
    } else {
       if (ctx->_Shader->Flags & GLSL_DUMP) {
          _mesa_log("GLSL source for %s shader %d:\n",




More information about the mesa-commit mailing list