mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
dispatch_sanity test: pass ctx to validate_functions/nops
This will allow validate_functions to access ctx->Version. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
parent
2ad1b13508
commit
7e64fe583f
1 changed files with 13 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue