From 366366c7f7fe24d9bc2a7f3d7464c49ccdb73813 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 29 Apr 2015 20:56:17 -0700 Subject: [PATCH] nir/types: Add a scalar type constructor --- src/glsl/nir/nir_types.cpp | 6 ++++++ src/glsl/nir/nir_types.h | 1 + 2 files changed, 7 insertions(+) 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, -- 2.30.2