glsl: move builtin vector types to glsl_types.cpp
authorRob Clark <robclark@freedesktop.org>
Sat, 10 Oct 2015 16:39:57 +0000 (12:39 -0400)
committerRob Clark <robclark@freedesktop.org>
Fri, 16 Oct 2015 23:33:37 +0000 (19:33 -0400)
First step at untangling NIR's dependency on glsl_types without bringing
in the dependency on glsl_symbol_table.  The builtin types are now in
glsl_types (which will end up in NIR), but adding them to the symbol-
table stays in builtin_types.cpp (which will not be part of NIR).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/glsl/builtin_types.cpp
src/glsl/glsl_types.cpp

index 0aedbb3546ab844f46b5915fd3890ed9a1fed16a..bbdcd199e9204b0c62676251959221845982fe1a 100644 (file)
@@ -43,9 +43,7 @@
  * convenience pointers (glsl_type::foo_type).
  * @{
  */
-#define DECL_TYPE(NAME, ...)                                    \
-   const glsl_type glsl_type::_##NAME##_type = glsl_type(__VA_ARGS__, #NAME); \
-   const glsl_type *const glsl_type::NAME##_type = &glsl_type::_##NAME##_type;
+#define DECL_TYPE(NAME, ...)
 
 #define STRUCT_TYPE(NAME)                                       \
    const glsl_type glsl_type::_struct_##NAME##_type =           \
index 27934478e2dafb945fec37c1bb31581f30e721ac..1c66dce85c47b156982d0d262269906472f66ad6 100644 (file)
@@ -1729,3 +1729,17 @@ glsl_type::coordinate_components() const
 
    return size;
 }
+
+/**
+ * Declarations of type flyweights (glsl_type::_foo_type) and
+ * convenience pointers (glsl_type::foo_type).
+ * @{
+ */
+#define DECL_TYPE(NAME, ...)                                    \
+   const glsl_type glsl_type::_##NAME##_type = glsl_type(__VA_ARGS__, #NAME); \
+   const glsl_type *const glsl_type::NAME##_type = &glsl_type::_##NAME##_type;
+
+#define STRUCT_TYPE(NAME)
+
+#include "builtin_type_macros.h"
+/** @} */