diff options
author | Kenneth Graunke <[email protected]> | 2012-07-25 23:07:16 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-07-30 15:14:09 -0700 |
commit | 13cb99dc73f9337358c92412aefa918c2ec16431 (patch) | |
tree | a2b3abe57e90efadeccb19683adf3424a0c827a4 /src | |
parent | cd0949eb2869ec37b135fdff2110090008bbcff6 (diff) |
glsl: Make bvec and ivec types accessible without using get_instance.
It's more convenient to use shortcuts like glsl_type::bvec2_type than
the longwinded glsl_type::get_instance(GLSL_TYPE_BOOL, 2, 1).
Signed-off-by: Ian Romanick <[email protected]>
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Olivier Galibert <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/builtin_types.h | 5 | ||||
-rw-r--r-- | src/glsl/glsl_types.h | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/builtin_types.h b/src/glsl/builtin_types.h index 8c136e4ab11..d75c5626157 100644 --- a/src/glsl/builtin_types.h +++ b/src/glsl/builtin_types.h @@ -63,7 +63,12 @@ const glsl_type glsl_type::builtin_core_types[] = { }; const glsl_type *const glsl_type::bool_type = & builtin_core_types[0]; +const glsl_type *const glsl_type::bvec2_type = & builtin_core_types[1]; +const glsl_type *const glsl_type::bvec3_type = & builtin_core_types[2]; +const glsl_type *const glsl_type::bvec4_type = & builtin_core_types[3]; const glsl_type *const glsl_type::int_type = & builtin_core_types[4]; +const glsl_type *const glsl_type::ivec2_type = & builtin_core_types[5]; +const glsl_type *const glsl_type::ivec3_type = & builtin_core_types[6]; const glsl_type *const glsl_type::ivec4_type = & builtin_core_types[7]; const glsl_type *const glsl_type::float_type = & builtin_core_types[8]; const glsl_type *const glsl_type::vec2_type = & builtin_core_types[9]; diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index bbc524d30eb..915d1a22b24 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -152,6 +152,8 @@ struct glsl_type { static const glsl_type *const error_type; static const glsl_type *const void_type; static const glsl_type *const int_type; + static const glsl_type *const ivec2_type; + static const glsl_type *const ivec3_type; static const glsl_type *const ivec4_type; static const glsl_type *const uint_type; static const glsl_type *const uvec2_type; @@ -162,6 +164,9 @@ struct glsl_type { static const glsl_type *const vec3_type; static const glsl_type *const vec4_type; static const glsl_type *const bool_type; + static const glsl_type *const bvec2_type; + static const glsl_type *const bvec3_type; + static const glsl_type *const bvec4_type; static const glsl_type *const mat2_type; static const glsl_type *const mat2x3_type; static const glsl_type *const mat2x4_type; |