[Mesa-dev] [wip 4/9] glsl: add MESA_SHADER_CACHE_MAGIC string for shader binary cache

Tapani Pälli tapani.palli at intel.com
Thu Jan 2 03:58:16 PST 2014


Patch adds a string that can be used by binary cache to identify
that shader binaries were generated with exact same Mesa library.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/glsl/shader_cache_magic.h | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/glsl/shader_cache_magic.h

diff --git a/src/glsl/shader_cache_magic.h b/src/glsl/shader_cache_magic.h
new file mode 100644
index 0000000..b4e99e2
--- /dev/null
+++ b/src/glsl/shader_cache_magic.h
@@ -0,0 +1,36 @@
+/* -*- c++ -*- */
+/*
+ * Copyright © 2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef SHADER_CACHE_MAGIC_H
+#define SHADER_CACHE_MAGIC_H
+
+#define MESA_SHADER_CACHE_MAGIC __DATE__ " " __TIME__
+
+inline const char *
+mesa_get_shader_cache_magic()
+{
+   return MESA_SHADER_CACHE_MAGIC;
+}
+
+#endif
-- 
1.8.3.1



More information about the mesa-dev mailing list