Browse Source

nir: Add a glsl_vec_type() helper.

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@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
tags/11.2-branchpoint
Kenneth Graunke 9 years ago
parent
commit
2bcf989407
2 changed files with 7 additions and 0 deletions
  1. 6
    0
      src/glsl/nir/nir_types.cpp
  2. 1
    0
      src/glsl/nir/nir_types.h

+ 6
- 0
src/glsl/nir/nir_types.cpp View File

@@ -167,6 +167,12 @@ glsl_float_type(void)
return glsl_type::float_type;
}

const glsl_type *
glsl_vec_type(unsigned n)
{
return glsl_type::vec(n);
}

const glsl_type *
glsl_vec4_type(void)
{

+ 1
- 0
src/glsl/nir/nir_types.h View File

@@ -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,

Loading…
Cancel
Save