[Mesa-dev] [PATCH 01/13] nir: Add a glsl_vec_type() helper.

Jason Ekstrand jason at jlekstrand.net
Tue Dec 22 07:14:26 PST 2015


I think I've written this patch before...

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
On Dec 22, 2015 2:21 AM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:

> I need access to glsl_type::vec2_type from C.  Wrapping vec() also gives
> us access to vec3 if we need it.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  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 135591a..41ac546 100644
> --- a/src/glsl/nir/nir_types.cpp
> +++ b/src/glsl/nir/nir_types.cpp
> @@ -168,6 +168,12 @@ glsl_float_type(void)
>  }
>
>  const glsl_type *
> +glsl_vec_type(unsigned n)
> +{
> +   return glsl_type::vec(n);
> +}
> +
> +const glsl_type *
>  glsl_vec4_type(void)
>  {
>     return glsl_type::vec4_type;
> diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h
> index b0b5184..64a75f6 100644
> --- a/src/glsl/nir/nir_types.h
> +++ b/src/glsl/nir/nir_types.h
> @@ -75,6 +75,7 @@ bool glsl_type_is_matrix(const struct glsl_type *type);
>
>  const struct glsl_type *glsl_void_type(void);
>  const struct glsl_type *glsl_float_type(void);
> +const struct glsl_type *glsl_vec_type(unsigned n);
>  const struct glsl_type *glsl_vec4_type(void);
>  const struct glsl_type *glsl_uint_type(void);
>  const struct glsl_type *glsl_array_type(const struct glsl_type *base,
> --
> 2.6.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151222/2ee7edd8/attachment.html>


More information about the mesa-dev mailing list