summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/tests/dispatch_sanity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/tests/dispatch_sanity.cpp')
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 1233b04ae88..474413cbf57 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -112,8 +112,10 @@ offset_to_proc_name_safe(unsigned offset)
* _glapi_proc *table exist. When found, set their pointers in the table
* to _mesa_generic_nop. */
static void
-validate_functions(_glapi_proc *table, const struct function *function_table)
+validate_functions(struct gl_context *ctx, const struct function *function_table)
{
+ _glapi_proc *table = (_glapi_proc *) ctx->Exec;
+
for (unsigned i = 0; function_table[i].name != NULL; i++) {
const int offset = (function_table[i].offset != -1)
? function_table[i].offset
@@ -135,8 +137,10 @@ validate_functions(_glapi_proc *table, const struct function *function_table)
/* Scan through the table and ensure that there is nothing except
* _mesa_generic_nop (as set by validate_functions(). */
static void
-validate_nops(const _glapi_proc *table)
+validate_nops(struct gl_context *ctx)
{
+ _glapi_proc *table = (_glapi_proc *) ctx->Exec;
+
const unsigned size = _glapi_get_dispatch_table_size();
for (unsigned i = 0; i < size; i++) {
EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i])
@@ -159,8 +163,8 @@ TEST_F(DispatchSanity_test, GLES11)
_tnl_CreateContext(&ctx);
_swsetup_CreateContext(&ctx);
- validate_functions((_glapi_proc *) ctx.Exec, gles11_functions_possible);
- validate_nops((_glapi_proc *) ctx.Exec);
+ validate_functions(&ctx, gles11_functions_possible);
+ validate_nops(&ctx);
}
#endif /* FEATURE_ES1 */
@@ -178,8 +182,8 @@ TEST_F(DispatchSanity_test, GLES2)
_tnl_CreateContext(&ctx);
_swsetup_CreateContext(&ctx);
- validate_functions((_glapi_proc *) ctx.Exec, gles2_functions_possible);
- validate_nops((_glapi_proc *) ctx.Exec);
+ validate_functions(&ctx, gles2_functions_possible);
+ validate_nops(&ctx);
}
TEST_F(DispatchSanity_test, GLES3)
@@ -196,9 +200,9 @@ TEST_F(DispatchSanity_test, GLES3)
_tnl_CreateContext(&ctx);
_swsetup_CreateContext(&ctx);
- validate_functions((_glapi_proc *) ctx.Exec, gles2_functions_possible);
- validate_functions((_glapi_proc *) ctx.Exec, gles3_functions_possible);
- validate_nops((_glapi_proc *) ctx.Exec);
+ validate_functions(&ctx, gles2_functions_possible);
+ validate_functions(&ctx, gles3_functions_possible);
+ validate_nops(&ctx);
}
#if FEATURE_ES1