<div dir="ltr"><br><div class="gmail_extra">On 10 February 2018 at 11:33, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cc: Rhys Kidd <<a href="mailto:rhyskidd@gmail.com">rhyskidd@gmail.com</a>><br>
Fixes: 4bf986274728 ("glsl/tests: Add UINT64 and INT64 types")<br></blockquote><div><br><span class="gmail-m_-4869929727051375685gmail-m_-3796206122752663915gmail-il"><span class="gmail-m_-4869929727051375685gmail-il"><span class="gmail-il">Reviewed</span></span></span>-<span class="gmail-m_-4869929727051375685gmail-m_-3796206122752663915gmail-il"><span class="gmail-m_-4869929727051375685gmail-il"><span class="gmail-il">by</span></span></span>: <span class="gmail-m_-4869929727051375685gmail-m_-3796206122752663915gmail-il"><span class="gmail-m_-4869929727051375685gmail-il"><span class="gmail-il">Rhys</span></span></span> Kidd <<a href="mailto:rhyskidd@gmail.com" target="_blank">rhyskidd@gmail.com</a>><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
 .../glsl/tests/uniform_<wbr>initializer_utils.cpp       | 22 +++++++++++++++++++---<br>
 1 file changed, 19 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compiler/glsl/tests/<wbr>uniform_initializer_utils.cpp b/src/compiler/glsl/tests/<wbr>uniform_initializer_utils.cpp<br>
index 701c8ef4d091..0d7fa26752fd 100644<br>
--- a/src/compiler/glsl/tests/<wbr>uniform_initializer_utils.cpp<br>
+++ b/src/compiler/glsl/tests/<wbr>uniform_initializer_utils.cpp<br>
@@ -204,6 +204,22 @@ generate_array_data(void *mem_ctx, enum glsl_base_type base_type,<br>
    val = new(mem_ctx) ir_constant(array_type, &values_for_array);<br>
 }<br>
<br>
+static uint64_t<br>
+uint64_storage(union gl_constant_value *storage)<br>
+{<br>
+   uint64_t val;<br>
+   memcpy(&val, &storage->i, sizeof(uint64_t));<br>
+   return val;<br>
+}<br>
+<br>
+static uint64_t<br>
+double_storage(union gl_constant_value *storage)<br>
+{<br>
+   double val;<br>
+   memcpy(&val, &storage->i, sizeof(double));<br>
+   return val;<br>
+}<br>
+<br>
 /**<br>
  * Verify that the data stored for the uniform matches the initializer<br>
  *<br>
@@ -252,13 +268,13 @@ verify_data(gl_constant_value *storage, unsigned storage_array_size,<br>
            EXPECT_EQ(val->value.b[i] ? boolean_true : 0, storage[i].i);<br>
            break;<br>
         case GLSL_TYPE_DOUBLE:<br>
-           EXPECT_EQ(val->value.d[i], *(double *)&storage[i*2].i);<br>
+           EXPECT_EQ(val->value.d[i], double_storage(&storage[i*2]))<wbr>;<br>
            break;<br>
         case GLSL_TYPE_UINT64:<br>
-           EXPECT_EQ(val->value.u64[i], *(uint64_t *)&storage[i*2].i);<br>
+            EXPECT_EQ(val->value.u64[i], uint64_storage(&storage[i*2]))<wbr>;<br>
            break;<br>
         case GLSL_TYPE_INT64:<br>
-           EXPECT_EQ(val->value.i64[i], *(int64_t *)&storage[i*2].i);<br>
+           EXPECT_EQ(val->value.i64[i], uint64_storage(&storage[i*2]))<wbr>;<br>
            break;<br>
          case GLSL_TYPE_ATOMIC_UINT:<br>
         case GLSL_TYPE_STRUCT:<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.15.0<br>
<br>
</font></span></blockquote></div><br></div></div>