glsl: add ARB_shader_ballot enable
[mesa.git] / src / compiler / glsl / glsl_parser_extras.cpp
index 776636c03c9fde1406bf299199704b756aad933b..4629e78efa8118596729ea1c30c55d2d2ca4da6e 100644 (file)
@@ -627,6 +627,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(ARB_separate_shader_objects),
    EXT(ARB_shader_atomic_counter_ops),
    EXT(ARB_shader_atomic_counters),
+   EXT(ARB_shader_ballot),
    EXT(ARB_shader_bit_encoding),
    EXT(ARB_shader_clock),
    EXT(ARB_shader_draw_parameters),
@@ -1938,19 +1939,22 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
                              add_builtin_defines, state, ctx);
 
    if (!force_recompile) {
-      char buf[41];
-      _mesa_sha1_compute(source, strlen(source), shader->sha1);
-      if (ctx->Cache && disk_cache_has_key(ctx->Cache, shader->sha1)) {
-         /* We've seen this shader before and know it compiles */
-         if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {
-            fprintf(stderr, "deferring compile of shader: %s\n",
-                    _mesa_sha1_format(buf, shader->sha1));
-         }
-         shader->CompileStatus = compile_skipped;
+      if (ctx->Cache) {
+         char buf[41];
+         disk_cache_compute_key(ctx->Cache, source, strlen(source),
+                                shader->sha1);
+         if (disk_cache_has_key(ctx->Cache, shader->sha1)) {
+            /* We've seen this shader before and know it compiles */
+            if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {
+               _mesa_sha1_format(buf, shader->sha1);
+               fprintf(stderr, "deferring compile of shader: %s\n", buf);
+            }
+            shader->CompileStatus = compile_skipped;
 
-         free((void *)shader->FallbackSource);
-         shader->FallbackSource = NULL;
-         return;
+            free((void *)shader->FallbackSource);
+            shader->FallbackSource = NULL;
+            return;
+         }
       }
    } else {
       /* We should only ever end up here if a re-compile has been forced by a