summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/int64.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl/int64.glsl')
-rw-r--r--src/compiler/glsl/int64.glsl19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/compiler/glsl/int64.glsl b/src/compiler/glsl/int64.glsl
new file mode 100644
index 00000000000..f5fb01013c7
--- /dev/null
+++ b/src/compiler/glsl/int64.glsl
@@ -0,0 +1,19 @@
+/* Compile with:
+ *
+ * glsl_compiler --version 140 --dump-builder int64.glsl > builtin_int64.h
+ *
+ * Using version 1.40+ prevents built-in variables from being included.
+ */
+#version 140
+#extension GL_MESA_shader_integer_functions: require
+
+uvec2
+umul64(uvec2 a, uvec2 b)
+{
+ uvec2 result;
+
+ umulExtended(a.x, b.x, result.y, result.x);
+ result.y += a.x * b.y + a.y * b.x;
+
+ return result;
+}