On 3 March 2012 01:01, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</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">
<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'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 "roll-your-own" stuff could get replaced by GLEW (likely) or your new code (most definitely).</blockquote><div><br>Oh, you're right. That makes much more sense.<br><br>In the interest of minimizing code churn, I'd rather not rip out Glean's "roll-your-own" stuff until piglit-dispatch has proven its worth. So for the moment I think I'll just modify glutils.cpp's getProcAddress() function to call piglit_get_proc_address(), and in turn I'll modify piglit_get_proc_address() to fetch the function pointer from piglit-dispatch.<br>
<br>I'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 "glew.h"<br>
+<br>
#ifdef __UNIX__<br>
#include<unistd.h><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>