On 30 October 2012 11:25, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</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">
This will allow validate_functions to access ctx->Version.<br>
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
---<br>
src/mesa/main/tests/dispatch_sanity.cpp | 32 +++++++++++++++++++++----------<br>
1 file changed, 22 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
index e88c1ac..a081247 100644<br>
--- a/src/mesa/main/tests/dispatch_sanity.cpp<br>
+++ b/src/mesa/main/tests/dispatch_sanity.cpp<br>
@@ -89,6 +89,7 @@ public:<br>
struct dd_function_table driver_functions;<br>
struct gl_context share_list;<br>
struct gl_context ctx;<br>
+<br></blockquote><div><br>Unintentional extra whitespace, I presume?<br><br>With that fixed, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
};<br>
<br>
void<br>
@@ -113,8 +114,10 @@ offset_to_proc_name_safe(unsigned offset)<br>
* _glapi_proc *table exist. When found, set their pointers in the table<br>
* to _mesa_generic_nop. */<br>
static void<br>
-validate_functions(_glapi_proc *table, const struct function *function_table)<br>
+validate_functions(struct gl_context *ctx, const struct function *function_table)<br>
{<br>
+ _glapi_proc *table = (_glapi_proc *) ctx->Exec;<br>
+<br>
for (unsigned i = 0; function_table[i].name != NULL; i++) {<br>
const int offset = (function_table[i].offset != -1)<br>
? function_table[i].offset<br>
@@ -136,8 +139,10 @@ validate_functions(_glapi_proc *table, const struct function *function_table)<br>
/* Scan through the table and ensure that there is nothing except<br>
* _mesa_generic_nop (as set by validate_functions(). */<br>
static void<br>
-validate_nops(const _glapi_proc *table)<br>
+validate_nops(struct gl_context *ctx)<br>
{<br>
+ _glapi_proc *table = (_glapi_proc *) ctx->Exec;<br>
+<br>
const unsigned size = _glapi_get_dispatch_table_size();<br>
for (unsigned i = 0; i < size; i++) {<br>
EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i])<br>
@@ -148,9 +153,16 @@ validate_nops(const _glapi_proc *table)<br>
#if FEATURE_ES1<br>
TEST_F(DispatchSanity_test, GLES11)<br>
{<br>
- _glapi_proc *exec = (_glapi_proc *) _mesa_create_exec_table_es1();<br>
- validate_functions(exec, gles11_functions_possible);<br>
- validate_nops(exec);<br>
+ ctx.Version = 11;<br>
+ _mesa_initialize_context(&ctx,<br>
+ API_OPENGLES, //api,<br>
+ &visual,<br>
+ NULL, //&share_list,<br>
+ &driver_functions);<br>
+<br>
+ ctx.Exec = _mesa_create_exec_table_es1();<br>
+ validate_functions(&ctx, gles11_functions_possible);<br>
+ validate_nops(&ctx);<br>
}<br>
#endif /* FEATURE_ES1 */<br>
<br>
@@ -168,8 +180,8 @@ TEST_F(DispatchSanity_test, GLES2)<br>
_tnl_CreateContext(&ctx);<br>
_swsetup_CreateContext(&ctx);<br>
<br>
- validate_functions((_glapi_proc *) ctx.Exec, gles2_functions_possible);<br>
- validate_nops((_glapi_proc *) ctx.Exec);<br>
+ validate_functions(&ctx, gles2_functions_possible);<br>
+ validate_nops(&ctx);<br>
}<br>
<br>
TEST_F(DispatchSanity_test, GLES3)<br>
@@ -186,9 +198,9 @@ TEST_F(DispatchSanity_test, GLES3)<br>
_tnl_CreateContext(&ctx);<br>
_swsetup_CreateContext(&ctx);<br>
<br>
- validate_functions((_glapi_proc *) ctx.Exec, gles2_functions_possible);<br>
- validate_functions((_glapi_proc *) ctx.Exec, gles3_functions_possible);<br>
- validate_nops((_glapi_proc *) ctx.Exec);<br>
+ validate_functions(&ctx, gles2_functions_possible);<br>
+ validate_functions(&ctx, gles3_functions_possible);<br>
+ validate_nops(&ctx);<br>
}<br>
<br>
#if FEATURE_ES1<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<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" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br>