<div dir="ltr"><div dir="ltr">Please CC and close <a href="https://bugs.freedesktop.org/show_bug.cgi?id=108532">https://bugs.freedesktop.org/show_bug.cgi?id=108532</a> when you push this.</div><div dir="ltr"><br></div><div>--Jason<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 23, 2018 at 12:12 PM Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 23, 2018 at 9:55 AM Juan A. Suarez Romero <<a href="mailto:jasuarez@igalia.com" target="_blank">jasuarez@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Use nir_src_comp_as_uint() to read the proper second component, as<br>
nir_src_as_uint() returns the first one.<br>
<br>
v2: Use nir_src_comp_as_uint() [Jason]<br>
<br>
Fixes: 16870de8a0a ("nir: Use nir_src_is_const and nir_src_as_* in core<br>
code")<br>
Signed-off-by: Juan A. Suarez Romero <<a href="mailto:jasuarez@igalia.com" target="_blank">jasuarez@igalia.com</a>><br>
---<br>
src/compiler/nir/tests/vars_tests.cpp | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/tests/vars_tests.cpp b/src/compiler/nir/tests/vars_tests.cpp<br>
index 02c53804b84..a7bbeb02277 100644<br>
--- a/src/compiler/nir/tests/vars_tests.cpp<br>
+++ b/src/compiler/nir/tests/vars_tests.cpp<br>
@@ -375,7 +375,7 @@ TEST_F(nir_copy_prop_vars_test, store_store_load_different_components)<br>
ASSERT_TRUE(store_to_v1->src[1].is_ssa);<br>
<br>
ASSERT_TRUE(nir_src_is_const(store_to_v1->src[1]));<br>
- ASSERT_EQ(nir_src_as_uint(store_to_v1->src[1]), 20);<br>
+ ASSERT_EQ(nir_src_comp_as_uint(store_to_v1->src[1], 1), 20);<br>
break;<br>
}<br>
}<br>
@@ -424,7 +424,7 @@ TEST_F(nir_copy_prop_vars_test, store_store_load_different_components_in_many_bl<br>
ASSERT_TRUE(store_to_v1->src[1].is_ssa);<br>
<br>
ASSERT_TRUE(nir_src_is_const(store_to_v1->src[1]));<br>
- ASSERT_EQ(nir_src_as_uint(store_to_v1->src[1]), 20);<br>
+ ASSERT_EQ(nir_src_comp_as_uint(store_to_v1->src[1], 1), 20);<br>
break;<br>
}<br>
}<br>
-- <br>
2.17.2<br>
<br>
</blockquote></div>
</blockquote></div>