summaryrefslogtreecommitdiff
path: root/builtin_types.sh
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-09 15:17:37 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-09 15:49:31 -0800
commiteccf0bf5f2e261b315b2a473667f71cae50c6001 (patch)
tree16ae8d76defea299918afb477d6d78edbb14cdd4 /builtin_types.sh
parent3a9e989628e37a0122ff72c8ef52e82dcb5ff41a (diff)
Make glsl_type a class
Among other benefits, this cleans up a the hackery invovled in initializing the union field in builtin_types.h.
Diffstat (limited to 'builtin_types.sh')
-rwxr-xr-xbuiltin_types.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/builtin_types.sh b/builtin_types.sh
index 19dcbaf124..3c8fd879e3 100755
--- a/builtin_types.sh
+++ b/builtin_types.sh
@@ -24,7 +24,7 @@
# gen_integral_type <name> <base_type> <vector elements> <matrix rows>
function gen_integral_type
{
- printf ' { %17s, 0, 0, 0, 0, %u, %u, "%s", 0, {NULL} },\n' $2 $3 $4 $1
+ printf ' glsl_type( %17s, %u, %u, "%s"),\n' $2 $3 $4 $1
index=$((index + 1))
}
@@ -32,8 +32,8 @@ function gen_integral_type
function gen_struct_type
{
elements=$(printf "%s_fields" $1)
- printf ' {\n GLSL_TYPE_STRUCT, 0, 0, 0, 0, 0, 0, "%s",\n Elements(%s),\n {(void *) %s}\n },\n' \
- $1 $elements $elements
+ printf ' glsl_type(%s,\n Elements(%s),\n "%s"),\n' \
+ $elements $elements $1
}
# gen_sampler_type <name> <dimensions> <shadow> <array> <type>
@@ -55,7 +55,7 @@ function gen_sampler_type
name=$(printf "u%s" $name)
fi
- printf ' { GLSL_TYPE_SAMPLER, %21s, %u, %u, %15s, 0, 0,\n "%s", 0, {NULL} },\n' \
+ printf ' glsl_type(%21s, %u, %u, %15s, "%s"),\n' \
$2 $3 $4 $5 $name
}
@@ -119,9 +119,8 @@ cat <<EOF
#define Elements(x) (sizeof(x)/sizeof(*(x)))
#endif
-static const struct glsl_type error_type = {
- GLSL_TYPE_ERROR, 0, 0, 0, 0, 0, 0, "", 0, {NULL}
-};
+static const struct glsl_type error_type =
+ glsl_type(GLSL_TYPE_ERROR, 0, 0, "");
const struct glsl_type *const glsl_error_type = & error_type;