From: Jason Ekstrand Date: Thu, 30 Apr 2015 03:56:17 +0000 (-0700) Subject: nir/types: Add a scalar type constructor X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=366366c7f7fe24d9bc2a7f3d7464c49ccdb73813;p=mesa.git nir/types: Add a scalar type constructor --- diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp index f2894d40c78..f93a52b5fa5 100644 --- a/src/glsl/nir/nir_types.cpp +++ b/src/glsl/nir/nir_types.cpp @@ -184,6 +184,12 @@ glsl_vec4_type(void) return glsl_type::vec4_type; } +const glsl_type * +glsl_scalar_type(enum glsl_base_type base_type) +{ + return glsl_type::get_instance(base_type, 1, 1); +} + const glsl_type * glsl_vector_type(enum glsl_base_type base_type, unsigned components) { diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h index dd535770c9f..40a80ec7130 100644 --- a/src/glsl/nir/nir_types.h +++ b/src/glsl/nir/nir_types.h @@ -81,6 +81,7 @@ const struct glsl_type *glsl_uint_type(void); const struct glsl_type *glsl_bool_type(void); const struct glsl_type *glsl_vec4_type(void); +const struct glsl_type *glsl_scalar_type(enum glsl_base_type base_type); const struct glsl_type *glsl_vector_type(enum glsl_base_type base_type, unsigned components); const struct glsl_type *glsl_matrix_type(enum glsl_base_type base_type,