On 3 March 2012 01:01, Kenneth Graunke <span dir="ltr">&lt;<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>&gt;</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">
<div class="im">On 03/02/2012 03:40 PM, Paul Berry wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Previously glean didn&#39;t initialize GLEW, presumably because glean only<br>
uses GL 1.0 functions, and those functions bypass GLEW.<br>
</blockquote>
<br></div>
Not...exactly.  Have you seen glean/tglsl1.cpp?  It tests GL2 functionality, but appears to manually go grab a ton of function pointers.<br>
<br>
Presumably all this &quot;roll-your-own&quot; stuff could get replaced by GLEW (likely) or your new code (most definitely).</blockquote><div><br>Oh, you&#39;re right.  That makes much more sense.<br><br>In the interest of minimizing code churn, I&#39;d rather not rip out Glean&#39;s &quot;roll-your-own&quot; stuff until piglit-dispatch has proven its worth.  So for the moment I think I&#39;ll just modify glutils.cpp&#39;s getProcAddress() function to call piglit_get_proc_address(), and in turn I&#39;ll modify piglit_get_proc_address() to fetch the function pointer from piglit-dispatch.<br>
<br>I&#39;ll post follow-up patches that do this.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But once we<br>
switch to using piglit-dispatch instead of GLEW, we will need to<br>
initialize it in order for any GL functions to work.  This patch adds<br>
a call to glewInit() in the place where a call to<br>
piglit_dispatch_default_init() will eventually be needed.<br>
---<br>
  tests/glean/CMakeLists.gl.txt |    2 ++<br>
  tests/glean/tbase.h           |    6 ++++++<br>
  2 files changed, 8 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/tests/glean/CMakeLists.gl.<u></u>txt b/tests/glean/CMakeLists.gl.<u></u>txt<br>
index 04081a9..0221a25 100644<br>
--- a/tests/glean/CMakeLists.gl.<u></u>txt<br>
+++ b/tests/glean/CMakeLists.gl.<u></u>txt<br>
@@ -12,6 +12,7 @@ include_directories(<br>
        ${GLEXT_INCLUDE_DIR}<br>
        ${OPENGL_INCLUDE_PATH}<br>
        ${TIFF_INCLUDE_DIR}<br>
+       ${piglit_SOURCE_DIR}/tests/<u></u>util<br>
  )<br>
<br>
  add_executable (glean<br>
@@ -88,6 +89,7 @@ add_executable (glean<br>
  )<br>
<br>
  target_link_libraries (glean<br>
+       piglitutil<br>
        ${OPENGL_gl_LIBRARY}<br>
        ${OPENGL_glu_LIBRARY}<br>
        ${GLUT_glut_LIBRARY}<br>
diff --git a/tests/glean/tbase.h b/tests/glean/tbase.h<br>
index 16fe251..748ee62 100644<br>
--- a/tests/glean/tbase.h<br>
+++ b/tests/glean/tbase.h<br>
@@ -106,6 +106,8 @@ and tbasic.cpp.<br>
  #ifndef __tbase_h__<br>
  #define __tbase_h__<br>
<br>
+#include &quot;glew.h&quot;<br>
+<br>
  #ifdef __UNIX__<br>
  #include&lt;unistd.h&gt;<br>
  #endif<br>
@@ -309,6 +311,10 @@ public:<br>
                                        // XXX need to throw exception here<br>
                                }<br>
<br>
+                               // Make sure glew is initialized so we can call<br>
+                               // GL functions safely.<br>
+                               glewInit();<br>
+<br>
                                // Check if test is applicable to this context<br>
                                if (!isApplicable())<br>
                                        continue;<br>
</blockquote>
<br>
</div></div></blockquote></div><br>