<p dir="ltr">I think I've written this patch before...</p>
<p dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>></p>
<div class="gmail_quote">On Dec 22, 2015 2:21 AM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I need access to glsl_type::vec2_type from C. Wrapping vec() also gives<br>
us access to vec3 if we need it.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
src/glsl/nir/nir_types.cpp | 6 ++++++<br>
src/glsl/nir/nir_types.h | 1 +<br>
2 files changed, 7 insertions(+)<br>
<br>
diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp<br>
index 135591a..41ac546 100644<br>
--- a/src/glsl/nir/nir_types.cpp<br>
+++ b/src/glsl/nir/nir_types.cpp<br>
@@ -168,6 +168,12 @@ glsl_float_type(void)<br>
}<br>
<br>
const glsl_type *<br>
+glsl_vec_type(unsigned n)<br>
+{<br>
+ return glsl_type::vec(n);<br>
+}<br>
+<br>
+const glsl_type *<br>
glsl_vec4_type(void)<br>
{<br>
return glsl_type::vec4_type;<br>
diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h<br>
index b0b5184..64a75f6 100644<br>
--- a/src/glsl/nir/nir_types.h<br>
+++ b/src/glsl/nir/nir_types.h<br>
@@ -75,6 +75,7 @@ bool glsl_type_is_matrix(const struct glsl_type *type);<br>
<br>
const struct glsl_type *glsl_void_type(void);<br>
const struct glsl_type *glsl_float_type(void);<br>
+const struct glsl_type *glsl_vec_type(unsigned n);<br>
const struct glsl_type *glsl_vec4_type(void);<br>
const struct glsl_type *glsl_uint_type(void);<br>
const struct glsl_type *glsl_array_type(const struct glsl_type *base,<br>
--<br>
2.6.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>