summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-01-16 00:03:39 -0800
committerKenneth Graunke <[email protected]>2019-02-19 13:26:58 -0800
commit3c2c6bd1c7636793ccb5e25f05677ae02e0fdb47 (patch)
tree1daab7dcd2d790c095174174d5822ffae49f582a /src/mesa/program
parentdaf8ada08d70fed353c64206ed3ffc7be2c0bfde (diff)
compiler: Make is_64bit(GL_*) helper more broadly available
I'd like to use this in the prog_parameter.c code, so I need to move it into C, make it non-static, and so on. This probably isn't the ideal place for it, but I couldn't think of a better one. Acked-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/prog_parameter.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
index cc551c18910..78c9909f5cc 100644
--- a/src/mesa/program/prog_parameter.h
+++ b/src/mesa/program/prog_parameter.h
@@ -185,6 +185,37 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
return -1;
}
+static inline bool
+_mesa_gl_datatype_is_64bit(GLenum datatype)
+{
+ switch (datatype) {
+ case GL_DOUBLE:
+ case GL_DOUBLE_VEC2:
+ case GL_DOUBLE_VEC3:
+ case GL_DOUBLE_VEC4:
+ case GL_DOUBLE_MAT2:
+ case GL_DOUBLE_MAT2x3:
+ case GL_DOUBLE_MAT2x4:
+ case GL_DOUBLE_MAT3:
+ case GL_DOUBLE_MAT3x2:
+ case GL_DOUBLE_MAT3x4:
+ case GL_DOUBLE_MAT4:
+ case GL_DOUBLE_MAT4x2:
+ case GL_DOUBLE_MAT4x3:
+ case GL_INT64_ARB:
+ case GL_INT64_VEC2_ARB:
+ case GL_INT64_VEC3_ARB:
+ case GL_INT64_VEC4_ARB:
+ case GL_UNSIGNED_INT64_ARB:
+ case GL_UNSIGNED_INT64_VEC2_ARB:
+ case GL_UNSIGNED_INT64_VEC3_ARB:
+ case GL_UNSIGNED_INT64_VEC4_ARB:
+ return true;
+ default:
+ return false;
+ }
+}
+
#ifdef __cplusplus
}
#endif